detailsPageEdit.vue 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269
  1. <template>
  2. <div v-loading.fullscreen.lock="fullscreenLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button
  6. type="danger"
  7. style="border: none;background: none;color: red"
  8. icon="el-icon-arrow-left"
  9. @click="backToList"
  10. >返回列表
  11. </el-button>
  12. </div>
  13. <div>
  14. <div class="el-button&#45;&#45;small-yh add-customer-btn" v-if="param.paramValue == 1">
  15. <el-button type="success" size="small" @click="release()" :disabled="form.status !== 0">发布
  16. </el-button>
  17. <el-button type="warning" size="small" @click="toVoid()" :disabled="form.status !== 4">取消发布
  18. </el-button>
  19. <el-button type="primary" size="small" @click="storage()">保存</el-button>
  20. </div>
  21. <div class="el-button&#45;&#45;small-yh add-customer-btn" v-else>
  22. <el-button type="success" size="small" @click="release()" :disabled="form.status !== 3">发布
  23. </el-button>
  24. <el-button type="warning" size="small" @click="pleaseCheck()" :disabled="form.status !== 0">请核
  25. </el-button>
  26. <el-button type="warning" size="small" @click.stop="checkDialog = true,checkData = detailData.check"
  27. v-if="checkDisabled">审批
  28. </el-button>
  29. <el-button type="primary" size="small" @click="storage()">保存</el-button>
  30. <el-dropdown style="margin-left: 10px">
  31. <el-button type="primary" size="small">
  32. 业务处理<i class="el-icon-arrow-down el-icon--right"></i>
  33. </el-button>
  34. <el-dropdown-menu slot="dropdown">
  35. <el-dropdown-item @click.native="copyNew()" :disabled="!form.id">复制新增</el-dropdown-item>
  36. <el-dropdown-item @click.native="toVoid()" :disabled="form.status < 4 || !form.status">
  37. 取消发布
  38. </el-dropdown-item>
  39. <el-dropdown-item @click.native="checkScheduleDialog = true,checkId=form.id"
  40. :disabled="form.status < 0 || !form.status">审批流程
  41. </el-dropdown-item>
  42. </el-dropdown-menu>
  43. </el-dropdown>
  44. </div>
  45. </div>
  46. </div>
  47. <trade-card title="基础资料" style="margin-top: 50px">
  48. <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
  49. </trade-card>
  50. <trade-card title="箱信息">
  51. <avue-crud ref="crudBox" :key="key" :option="optionBox" :data="dataListBox"
  52. @resetColumn="resetColumn('crudBox','optionBox','optionBoxTwo',201.1)"
  53. @saveColumn="saveColumn('crudBox','optionBox','optionBoxTwo',201.1)">
  54. <template slot-scope="{row,index}" slot="menu">
  55. <el-button
  56. type="text"
  57. size="small"
  58. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  59. @click="edit(row)"
  60. >{{ row.$cellEdit ? '确 认' : '编 辑' }}
  61. </el-button>
  62. <el-button
  63. type="text"
  64. size="small"
  65. icon="el-icon-delete"
  66. v-if="form.status === 0 || !form.status"
  67. @click="rowDel(row,index,'box')"
  68. >删 除
  69. </el-button>
  70. </template>
  71. </avue-crud>
  72. </trade-card>
  73. <trade-card title="代理信息">
  74. <avue-crud ref="crudAgent" :key="key" :option="optionAgent" :data="dataListAgent" @row-update="rowUpdate"
  75. @row-save="rowSave"
  76. @resetColumn="resetColumn('crudAgent','optionAgent','optionAgentTwo',201.2)"
  77. @saveColumn="saveColumn('crudAgent','optionAgent','optionAgentTwo',201.2)">
  78. <template slot-scope="{row,index}" slot="menu">
  79. <el-button
  80. type="text"
  81. size="small"
  82. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  83. @click="edit(row,index,false)"
  84. >{{ row.$cellEdit ? '确 认' : '编 辑' }}
  85. </el-button>
  86. <el-button
  87. type="text"
  88. size="small"
  89. icon="el-icon-delete"
  90. v-if="form.status === 0 || !form.status"
  91. @click="rowDel(row,index,'agent')"
  92. >删 除
  93. </el-button>
  94. </template>
  95. <template slot="menuLeft">
  96. <el-button
  97. type="success"
  98. size="small"
  99. icon="el-icon-bottom"
  100. @click="dialogVisible = true"
  101. >导入
  102. </el-button>
  103. </template>
  104. </avue-crud>
  105. </trade-card>
  106. <trade-card title="投标对比">
  107. <avue-crud ref="crudBid" :key="key" :option="optionBid" :data="dataListBid"
  108. @resetColumn="resetColumn('crudBid','optionBid','optionBidTwo',201.3)"
  109. @saveColumn="saveColumn('crudBid','optionBid','optionBidTwo',201.3)">
  110. <template slot-scope="{row,index}" slot="menu">
  111. <el-button
  112. type="text"
  113. size="small"
  114. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  115. @click="edit(row)"
  116. >{{ row.$cellEdit ? '确 认' : '编 辑' }}
  117. </el-button>
  118. <el-button
  119. type="text"
  120. size="small"
  121. @click="winningTheBid(row,index)"
  122. v-if="row.status === 5"
  123. >确认中标
  124. </el-button>
  125. </template>
  126. </avue-crud>
  127. </trade-card>
  128. <el-dialog
  129. v-dialogdrag
  130. title="导入客户"
  131. :fullscreen="dialogFull"
  132. :visible.sync="dialogVisible"
  133. class="el-dialogDeep"
  134. append-to-body
  135. :close-on-click-modal="false"
  136. width="80%"
  137. >
  138. <template slot="title">
  139. <span class="el-dialog__title">
  140. <span
  141. style="display:inline-block;background-color: #3478f5;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"
  142. ></span>
  143. 导入客户
  144. </span>
  145. <div
  146. style="float: right"
  147. class="avue-crud__dialog__menu"
  148. @click="dialogFull ? (dialogFull = false) : (dialogFull = true)">
  149. <i class="el-icon-full-screen"></i>
  150. </div>
  151. </template>
  152. <el-row style="height: 0">
  153. <el-col :span="5">
  154. <div class="box">
  155. <el-scrollbar>
  156. <basic-container>
  157. <avue-tree
  158. :option="treeOption"
  159. :data="treeData"
  160. @node-click="nodeClick"
  161. />
  162. </basic-container>
  163. </el-scrollbar>
  164. </div>
  165. </el-col>
  166. <el-col :span="19">
  167. <basic-container>
  168. <avue-crud
  169. :option="option"
  170. :data="dataList"
  171. ref="crud"
  172. v-model="form"
  173. :page.sync="page"
  174. :before-close="beforeClose"
  175. @search-change="searchChange"
  176. @search-reset="searchReset"
  177. @refresh-change="refreshChange"
  178. @selection-change="selectionChange"
  179. @on-load="onLoad"
  180. @saveColumn="saveColumn('crud','option','option',47)"
  181. @tree-load="treeLoad"
  182. >
  183. </avue-crud>
  184. </basic-container>
  185. </el-col>
  186. </el-row>
  187. <span slot="footer" class="dialog-footer">
  188. <el-button @click="dialogVisible = false">取 消</el-button>
  189. <el-button
  190. type="primary"
  191. @click="confirmSelection"
  192. :disabled="selection.length > 0 ? false : true"
  193. >确 定</el-button>
  194. </span>
  195. </el-dialog>
  196. <el-dialog
  197. append-to-body
  198. title="审批"
  199. class="el-dialogDeep"
  200. :visible.sync="checkDialog"
  201. width="50%"
  202. :close-on-click-modal="false"
  203. :destroy-on-close="true"
  204. :close-on-press-escape="false"
  205. v-dialog-drag
  206. >
  207. <check
  208. :checkData="checkData"
  209. :checkDetail="false"
  210. :idList="[]"
  211. @choceCheckFun="checkDialog = false"
  212. >
  213. </check>
  214. </el-dialog>
  215. <el-dialog
  216. append-to-body
  217. title="审批进度"
  218. class="el-dialogDeep"
  219. :visible.sync="checkScheduleDialog"
  220. width="40%"
  221. :close-on-click-modal="false"
  222. :destroy-on-close="true"
  223. :close-on-press-escape="false"
  224. v-dialog-drag
  225. >
  226. <check-schedule
  227. :checkId="checkId"
  228. :batchNo="batchNo"
  229. @choceScheduleFun="checkScheduleDialog = false"
  230. >
  231. </check-schedule>
  232. </el-dialog>
  233. </div>
  234. </template>
  235. <script>
  236. import {
  237. detailDelegationList,
  238. saveSaveList,
  239. boxDelete,
  240. agentDelete,
  241. confirmRelease, confirmVoid, confirmPleaseCheck, confirmWinningTheBid, allList, paramList,corpByAttnList
  242. } from "@/api/bidingDocument/issueTender";
  243. import check from "@/components/check/check";
  244. import checkSchedule from "@/components/check/checkSchedule";
  245. import {dateFormat} from "@/util/date";
  246. import option from "@/components/selectComponent/configuration/mainList.json";
  247. import {customerList, getDeptLazyTree} from "@/api/basicData/customerInformation";
  248. import {customerParameter} from "@/enums/management-type";
  249. import {getDictionary} from "@/api/system/dictbiz";
  250. export default {
  251. name: "detailsPageEdit",
  252. components: {
  253. check,
  254. checkSchedule
  255. },
  256. watch: {
  257. form: {
  258. handler(newValue, oldValue) {
  259. if (this.form.status > 0) {
  260. this.$set(this.optionForm, 'disabled', true)
  261. this.$set(this.optionBox, 'addRowBtn', false)
  262. this.$set(this.optionAgent, 'addRowBtn', false)
  263. this.optionBox.column.forEach(item => {
  264. this.$set(item, 'disabled', true)
  265. if (item.prop === "remark") {
  266. this.$set(item, 'disabled', false)
  267. }
  268. })
  269. this.optionAgent.column.forEach(item => {
  270. this.$set(item, 'disabled', true)
  271. if (item.prop === "remark") {
  272. this.$set(item, 'disabled', false)
  273. }
  274. })
  275. } else {
  276. this.$set(this.optionForm, 'disabled', false)
  277. this.findObject(this.optionForm.column, "status").disabled = true
  278. this.$set(this.optionBox, 'disabled', false)
  279. if (this.optionBox.column) {
  280. this.findObject(this.optionBox.column, "status").disabled = true
  281. }
  282. this.$set(this.optionAgent, 'disabled', false)
  283. if (this.optionAgent.column) {
  284. this.findObject(this.optionAgent.column, "status").disabled = true
  285. }
  286. }
  287. }
  288. }
  289. },
  290. data() {
  291. return {
  292. dialogVisible: false,
  293. option: {},
  294. treeOption: {
  295. nodeKey: "id",
  296. lazy: true,
  297. treeLoad: function (node, resolve) {
  298. const parentId = node.level === 0 ? 0 : node.data.id;
  299. getDeptLazyTree({
  300. parentId: parentId,
  301. corpType: customerParameter.code
  302. }).then(res => {
  303. resolve(
  304. res.data.data.map(item => {
  305. return {
  306. ...item,
  307. leaf: !item.hasChildren
  308. };
  309. })
  310. );
  311. });
  312. },
  313. addBtn: false,
  314. menu: false,
  315. size: "small",
  316. props: {
  317. labelText: "标题",
  318. label: "title",
  319. value: "value",
  320. children: "children"
  321. }
  322. },
  323. dataList: [],
  324. page: {
  325. pageSize: 10,
  326. pagerCount: 5,
  327. total: 0
  328. },
  329. dialogFull: false,
  330. checkDialog: false,
  331. checkScheduleDialog: false,
  332. checkId: '',
  333. batchNo: '',
  334. line: '',
  335. key: 0,
  336. selection: [],
  337. checkData: {},
  338. fullscreenLoading: false,
  339. optionForm: {
  340. submitBtn: false,
  341. emptyBtn: false,
  342. span: 6,
  343. column: [{
  344. label: '发布日期',
  345. prop: 'releaseTime',
  346. type: "datetime",
  347. format: 'yyyy-MM-dd HH:mm',
  348. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  349. value: dateFormat(new Date, 'yyyy-MM-dd hh:mm:ss'),
  350. rules: [{
  351. required: true,
  352. message: " ",
  353. trigger: "change"
  354. }],
  355. }, {
  356. label: '截止日期',
  357. prop: 'deadlineTime',
  358. type: "datetime",
  359. format: 'yyyy-MM-dd HH:mm',
  360. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  361. rules: [{
  362. required: true,
  363. message: " ",
  364. trigger: "change"
  365. }],
  366. }, {
  367. label: '合同号',
  368. prop: 'contractNo',
  369. rules: [{
  370. required: true,
  371. message: " ",
  372. trigger: "change"
  373. }],
  374. }, {
  375. label: '状态',
  376. disabled: true,
  377. prop: 'status',
  378. dataType: "number",
  379. type: 'select',
  380. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  381. props: {
  382. label: "dictValue",
  383. value: "dictKey"
  384. }
  385. }, {
  386. label: '起运港',
  387. prop: 'departureHarbor',
  388. filterable: true,
  389. type: "select",
  390. dicUrl: "/api/blade-client/port/allList",
  391. props: {
  392. label: "name",
  393. value: "name"
  394. },
  395. rules: [{
  396. required: true,
  397. message: " ",
  398. trigger: "change"
  399. }],
  400. }, {
  401. label: '目的港',
  402. prop: 'objectiveHarbor',
  403. filterable: true,
  404. type: "select",
  405. dicUrl: "/api/blade-client/port/allList",
  406. props: {
  407. label: "name",
  408. value: "name"
  409. },
  410. change: (data) => {
  411. allList().then(res => {
  412. for (let item of res.data.data) {
  413. if (data.value == item.name) {
  414. this.line = item.line
  415. }
  416. }
  417. })
  418. },
  419. rules: [{
  420. required: true,
  421. message: " ",
  422. trigger: "change"
  423. }],
  424. }, {
  425. label: '起运地',
  426. prop: 'departureLand',
  427. filterable: true,
  428. type: "select",
  429. dicUrl: "/api/blade-client/port/allList",
  430. props: {
  431. label: "name",
  432. value: "name"
  433. }
  434. }, {
  435. label: '目的地',
  436. prop: 'objectiveLand',
  437. filterable: true,
  438. type: "select",
  439. dicUrl: "/api/blade-client/port/allList",
  440. props: {
  441. label: "name",
  442. value: "name"
  443. }
  444. }, {
  445. label: '装柜日期',
  446. prop: 'loadingTime',
  447. type: "datetime",
  448. format: 'yyyy-MM-dd HH:mm',
  449. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  450. rules: [{
  451. required: true,
  452. message: " ",
  453. trigger: "change"
  454. }],
  455. }, {
  456. label: '是否直航',
  457. prop: 'directFlight',
  458. type: 'select',
  459. dicData: [{
  460. label: '是',
  461. value: 1
  462. }, {
  463. label: '否',
  464. value: 0
  465. }],
  466. value: 1,
  467. rules: [{
  468. required: true,
  469. message: " ",
  470. trigger: "change"
  471. }],
  472. }, {
  473. label: '转港',
  474. prop: 'transshipment',
  475. filterable: true,
  476. type: "select",
  477. dicUrl: "/api/blade-client/port/allList",
  478. props: {
  479. label: "name",
  480. value: "name"
  481. }
  482. }, {
  483. label: '运输方式',
  484. prop: 'transportType',
  485. type: 'select',
  486. dicUrl: "/api/blade-system/dict-biz/dictionary?code=mode_transport",
  487. props: {
  488. label: "dictValue",
  489. value: "dictValue"
  490. },
  491. value: "海运",
  492. rules: [{
  493. required: true,
  494. message: " ",
  495. trigger: "change"
  496. }],
  497. }, {
  498. label: '运输条款',
  499. prop: 'transportClause',
  500. value: "CY-CY",
  501. rules: [{
  502. required: true,
  503. message: " ",
  504. trigger: "change"
  505. }],
  506. }, {
  507. label: '件数',
  508. prop: 'number',
  509. value: 10,
  510. rules: [{
  511. required: true,
  512. message: " ",
  513. trigger: "change"
  514. }],
  515. }, {
  516. label: '包装',
  517. prop: 'packing',
  518. type: 'select',
  519. dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  520. props: {
  521. label: "dictValue",
  522. value: "dictValue"
  523. },
  524. value: "木箱",
  525. rules: [{
  526. required: true,
  527. message: " ",
  528. trigger: "change"
  529. }],
  530. }, {
  531. label: '重量(kgs)',
  532. prop: 'weight',
  533. value: 27000,
  534. rules: [{
  535. required: true,
  536. message: " ",
  537. trigger: "change"
  538. }],
  539. }, {
  540. label: '尺码(cmb)',
  541. prop: 'size',
  542. value: 18,
  543. rules: [{
  544. required: true,
  545. message: " ",
  546. trigger: "change"
  547. }],
  548. }, {
  549. label: '货物信息',
  550. prop: 'cargoInformation',
  551. span: 18,
  552. value: "GLASS",
  553. rules: [{
  554. required: true,
  555. message: " ",
  556. trigger: "change"
  557. }],
  558. }, {
  559. label: '备注',
  560. prop: 'remark',
  561. type: 'textarea',
  562. span: 24,
  563. }]
  564. },
  565. optionBox: {},
  566. optionBoxTwo: {
  567. align: 'center',
  568. index: true,
  569. refreshBtn: false,
  570. addBtn: false,
  571. addRowBtn: true,
  572. cellBtn: false,
  573. editBtn: false,
  574. delBtn: false,
  575. column: [{
  576. label: '箱型',
  577. prop: 'boxType',
  578. cell: true,
  579. type: "select",
  580. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  581. props: {
  582. label: "dictValue",
  583. value: "dictValue"
  584. },
  585. index: 1,
  586. }, {
  587. label: '箱量',
  588. prop: 'boxAmount',
  589. cell: true,
  590. index: 2,
  591. },
  592. // {
  593. // label: '海运费',
  594. // prop: 'seaFreight',
  595. // cell: true,
  596. // index:3,
  597. // }, {
  598. // label: '起运港箱使费',
  599. // prop: 'departureHarborFee',
  600. // cell: true,
  601. // index:4,
  602. // }, {
  603. // label: '目的港箱使费',
  604. // prop: 'objectiveHarborFee',
  605. // cell: true,
  606. // index:5,
  607. // },
  608. {
  609. label: '状态',
  610. prop: 'status',
  611. type: 'select',
  612. dataType: "string",
  613. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  614. props: {
  615. label: "dictValue",
  616. value: "dictKey"
  617. },
  618. index: 6,
  619. }, {
  620. label: '备注',
  621. prop: 'remark',
  622. cell: true,
  623. index: 7,
  624. }]
  625. },
  626. optionAgent: {},
  627. optionAgentTwo: {
  628. align: 'center',
  629. index: true,
  630. refreshBtn: false,
  631. addBtn: false,
  632. addRowBtn: true,
  633. cellBtn: false,
  634. editBtn: false,
  635. delBtn: false,
  636. column: [{
  637. label: '名称',
  638. prop: 'agentId',
  639. filterable: true,
  640. cell: true,
  641. dicUrl: '/api/blade-client/corpsdesc/bidingCorpsList?corpsTypeName=货代',
  642. type: 'select',
  643. props: {
  644. label: "cname",
  645. value: "id"
  646. },
  647. cascader: ['contacts'],
  648. rules: [{
  649. required: true,
  650. message: " ",
  651. trigger: "change"
  652. }],
  653. index: 1,
  654. }, {
  655. label: '联系人',
  656. prop: 'contacts',
  657. cell: true,
  658. index: 2,
  659. type: 'select',
  660. dicUrl: `/api/blade-client/corpsattn/corpByAttnList?corpId={{agentId}}`,
  661. props: {
  662. label: 'cname',
  663. value: 'cname'
  664. },
  665. allowCreate: true,
  666. filterable: true,
  667. }, {
  668. label: '邮箱',
  669. prop: 'mailbox',
  670. cell: true,
  671. index: 3,
  672. }, {
  673. label: '电话',
  674. prop: 'phone',
  675. cell: true,
  676. index: 4,
  677. }, {
  678. label: '状态',
  679. prop: 'status',
  680. type: 'select',
  681. dataType: "string",
  682. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  683. props: {
  684. label: "dictValue",
  685. value: "dictKey"
  686. },
  687. index: 5,
  688. }, {
  689. label: '备注',
  690. prop: 'remark',
  691. cell: true,
  692. index: 6,
  693. }]
  694. },
  695. optionBid: {},
  696. optionBidTwo: {
  697. align: 'center',
  698. index: true,
  699. refreshBtn: false,
  700. addBtn: false,
  701. addRowBtn: false,
  702. cellBtn: false,
  703. editBtn: false,
  704. delBtn: false,
  705. menuWidth: 150,
  706. column: [{
  707. label: '名称',
  708. prop: 'contrastName',
  709. index: 1,
  710. }, {
  711. label: '箱型',
  712. prop: 'boxType',
  713. type: "select",
  714. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  715. props: {
  716. label: "dictValue",
  717. value: "dictValue"
  718. },
  719. index: 2,
  720. }, {
  721. label: '运费',
  722. prop: 'seaFreight',
  723. index: 3,
  724. },{
  725. label: '船公司',
  726. prop: 'shippingCompany',
  727. index: 4,
  728. }, {
  729. label: '目的港箱使天数',
  730. prop: 'objectiveHarborFee',
  731. index: 5,
  732. },{
  733. label: '船期',
  734. prop: 'shippingDate',
  735. index: 6,
  736. }, {
  737. label: '主单/分单',
  738. prop: 'documentType',
  739. index: 7,
  740. }, {
  741. label: '航程',
  742. prop: 'voyage',
  743. index: 8,
  744. }, {
  745. label: '亏舱费用',
  746. prop: 'brokenStowageAmount',
  747. index: 9,
  748. },{
  749. label: '截单时间',
  750. prop: 'cutOffTime',
  751. index: 10,
  752. },{
  753. label: '备注',
  754. prop: 'remark',
  755. cell: true,
  756. index: 11,
  757. },{
  758. label: '截港时间',
  759. prop: 'harborInterceptionTime',
  760. index: 12,
  761. }, {
  762. label: '竞价排名',
  763. prop: 'ranking',
  764. index: 13,
  765. }, {
  766. label: '起运港箱使天数',
  767. prop: 'departureHarborFee',
  768. index: 14,
  769. }, {
  770. label: '船名',
  771. prop: 'shipName',
  772. index: 15,
  773. }, {
  774. label: '状态',
  775. prop: 'status',
  776. type: 'select',
  777. dataType: "string",
  778. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  779. props: {
  780. label: "dictValue",
  781. value: "dictKey"
  782. },
  783. index: 16,
  784. }]
  785. },
  786. form: {},
  787. dataListBox: [],
  788. dataListAgent: [],
  789. dataListBid: [],
  790. param: {},
  791. checkDisabled: false
  792. }
  793. },
  794. props: {
  795. id: {
  796. type: String
  797. },
  798. detailData: {
  799. type: Object
  800. }
  801. },
  802. async created() {
  803. this.option = await this.getColumnData(this.getColumnName(47), option);
  804. this.optionBox = await this.getColumnData(this.getColumnName(201.1), this.optionBoxTwo);
  805. this.optionAgent = await this.getColumnData(this.getColumnName(201.2), this.optionAgentTwo);
  806. this.optionBid = await this.getColumnData(this.getColumnName(201.3), this.optionBidTwo);
  807. this.key++
  808. paramList({
  809. paramKey: "release.approval",
  810. current: 1,
  811. size: 10
  812. }).then(res => {
  813. for (let item of res.data.data.records) {
  814. if (item.paramKey === "release.approval") {
  815. this.param = item
  816. }
  817. }
  818. })
  819. if (this.id) {
  820. this.refreshData(this.id)
  821. }
  822. if (this.detailData.check) {
  823. this.checkDisabled = true
  824. this.batchNo = this.detailData.check.batchNo
  825. }
  826. this.findObject(this.optionAgent.column, "contacts").change = ({row,column,value}) => {
  827. corpByAttnList({corpId:row.agentId}).then(res=>{
  828. for (let item of res.data.data){
  829. if (item.cname == value){
  830. row.mailbox = item.email
  831. row.phone = item.tel
  832. }
  833. }
  834. })
  835. }
  836. this.findObject(this.optionAgent.column, "agentId").change = ({row, value, column}) => {
  837. for (let item of this.$refs.crudAgent.DIC[column.prop]){
  838. if (item.id == value){
  839. corpByAttnList({corpId:value}).then(res=>{
  840. if (res.data.data.length>0){
  841. console.log()
  842. row.contacts = res.data.data[0].cname
  843. row.mailbox = res.data.data[0].email
  844. row.phone = res.data.data[0].tel
  845. }
  846. })
  847. }
  848. }
  849. }
  850. },
  851. methods: {
  852. nodeClick(data) {
  853. this.treeDeptId = data.id;
  854. this.page.currentPage = 1;
  855. this.onLoad(this.page);
  856. },
  857. //确认导出触发
  858. confirmSelection() {
  859. for (let item of this.selection) {
  860. this.dataListAgent.push({
  861. $cellEdit: true,
  862. agentId: item.id,
  863. contacts: item.attn,
  864. phone: item.tel
  865. })
  866. }
  867. this.selection = [];
  868. this.dialogVisible = false;
  869. },
  870. //点击新增时触发
  871. beforeClose(done) {
  872. this.parentId = "";
  873. const column = this.findObject(this.option.column, "parentId");
  874. column.value = "";
  875. column.addDisabled = false;
  876. done();
  877. },
  878. //点击搜索按钮触发
  879. searchChange(params, done) {
  880. console.log(params);
  881. this.treeDeptId = "";
  882. this.page.currentPage = 1;
  883. this.onLoad(this.page, params);
  884. done();
  885. },
  886. //搜索重置按钮触发
  887. searchReset() {
  888. this.treeDeptId = "";
  889. this.onLoad(this.page);
  890. },
  891. //刷新触发
  892. refreshChange() {
  893. this.page = {
  894. pageSize: 10,
  895. pagerCount: 5,
  896. total: 0
  897. };
  898. },
  899. //选中触发
  900. selectionChange(selection) {
  901. this.selection = selection;
  902. },
  903. //树桩列点击展开触发
  904. treeLoad(tree, treeNode, resolve) {
  905. const parentId = tree.id;
  906. customerList({
  907. parentId: parentId,
  908. corpType: this.corpType ? this.corpType : "KH"
  909. }).then(res => {
  910. resolve(res.data.data.records);
  911. });
  912. },
  913. onLoad(page, params = {parentId: 0}) {
  914. let queryParams = Object.assign({}, params, {
  915. size: page.pageSize,
  916. current: page.currentPage,
  917. corpsTypeId: this.treeDeptId,
  918. corpType: this.corpType ? this.corpType : "KH",
  919. line: this.line
  920. });
  921. customerList(queryParams).then(res => {
  922. this.dataList = res.data.data.records;
  923. this.page.total = res.data.data.total;
  924. if (this.page.total) {
  925. this.option.height = window.innerHeight - 500;
  926. } else {
  927. this.option.height = window.innerHeight - 200;
  928. }
  929. });
  930. },
  931. //自定义列保存
  932. async saveColumn(ref, option, optionBack, code) {
  933. /**
  934. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  935. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  936. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  937. */
  938. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  939. if (inSave) {
  940. this.$message.success("保存成功");
  941. //关闭窗口
  942. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  943. }
  944. },
  945. //自定义列重置
  946. async resetColumn(ref, option, optionBack, code) {
  947. this[option] = this[optionBack];
  948. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  949. if (inSave) {
  950. this.$message.success("重置成功");
  951. if (this.form.status > 0) {
  952. this.$set(this.optionForm, 'disabled', true)
  953. this.$set(this.optionBox, 'addRowBtn', false)
  954. this.$set(this.optionAgent, 'addRowBtn', false)
  955. this.optionBox.column.forEach(item => {
  956. this.$set(item, 'disabled', true)
  957. if (item.prop === "remark") {
  958. this.$set(item, 'disabled', false)
  959. }
  960. })
  961. this.optionAgent.column.forEach(item => {
  962. this.$set(item, 'disabled', true)
  963. if (item.prop === "remark") {
  964. this.$set(item, 'disabled', false)
  965. }
  966. })
  967. } else {
  968. this.$set(this.optionForm, 'disabled', false)
  969. this.findObject(this.optionForm.column, "status").disabled = true
  970. this.$set(this.optionBox, 'disabled', false)
  971. this.findObject(this.optionBox.column, "status").disabled = true
  972. this.$set(this.optionAgent, 'disabled', false)
  973. this.findObject(this.optionAgent.column, "status").disabled = true
  974. }
  975. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  976. this.findObject(this.optionAgent.column, "contacts").change = ({row,column,value}) => {
  977. corpByAttnList({corpId:row.agentId}).then(res=>{
  978. for (let item of res.data.data){
  979. if (item.cname == value){
  980. row.mailbox = item.email
  981. row.phone = item.tel
  982. }
  983. }
  984. })
  985. }
  986. this.findObject(this.optionAgent.column, "agentId").change = ({row, value, column}) => {
  987. for (let item of this.$refs.crudAgent.DIC[column.prop]){
  988. if (item.id == value){
  989. corpByAttnList({corpId:value}).then(res=>{
  990. if (res.data.data.length>0){
  991. row.contacts = res.data.data[0].cname
  992. row.mailbox = res.data.data[0].email
  993. row.phone = res.data.data[0].tel
  994. }
  995. })
  996. }
  997. }
  998. }
  999. }
  1000. },
  1001. edit(row, index, type = true) {
  1002. if (!type) {
  1003. this.$refs.crudAgent.rowCell(row, index)
  1004. } else {
  1005. if (row.$cellEdit) {
  1006. this.$set(row, '$cellEdit', false)
  1007. } else {
  1008. this.$set(row, '$cellEdit', true)
  1009. }
  1010. }
  1011. },
  1012. rowSave(form, done) {
  1013. done()
  1014. },
  1015. rowUpdate(form, index, done) {
  1016. done()
  1017. },
  1018. rowDel(row, index, type) {
  1019. this.$confirm('是否确认删除?', '提示', {
  1020. confirmButtonText: '确定',
  1021. cancelButtonText: '取消',
  1022. type: 'warning'
  1023. }).then(() => {
  1024. if (type === 'box') {
  1025. if (row.id) {
  1026. boxDelete({id: row.id}).then(res => {
  1027. this.dataListBox.splice(index, 1);
  1028. this.$message({
  1029. type: 'success',
  1030. message: '删除成功!'
  1031. });
  1032. })
  1033. } else {
  1034. this.dataListBox.splice(index, 1);
  1035. this.$message({
  1036. type: 'success',
  1037. message: '删除成功!'
  1038. });
  1039. }
  1040. } else if (type === 'agent') {
  1041. if (row.id) {
  1042. agentDelete({id: row.id}).then(res => {
  1043. this.dataListAgent.splice(index, 1);
  1044. this.$message({
  1045. type: 'success',
  1046. message: '删除成功!'
  1047. });
  1048. })
  1049. } else {
  1050. this.dataListAgent.splice(index, 1);
  1051. this.$message({
  1052. type: 'success',
  1053. message: '删除成功!'
  1054. });
  1055. }
  1056. }
  1057. }).catch(() => {
  1058. this.$message({
  1059. type: 'info',
  1060. message: '已取消'
  1061. });
  1062. });
  1063. },
  1064. backToList() {
  1065. this.$router.push({
  1066. path: '/bidingDocument/issueTender/index'
  1067. });
  1068. this.$emit('backToList', false)
  1069. },
  1070. // 确认中标
  1071. winningTheBid(row, index) {
  1072. this.$confirm('是否确认中标?', '提示', {
  1073. confirmButtonText: '确定',
  1074. cancelButtonText: '取消',
  1075. type: 'warning'
  1076. }).then(() => {
  1077. confirmWinningTheBid({id: row.id}).then(res => {
  1078. this.$message({
  1079. type: 'success',
  1080. message: '确认中标!'
  1081. });
  1082. this.refreshData(this.id)
  1083. })
  1084. }).catch(() => {
  1085. this.$message({
  1086. type: 'info',
  1087. message: '已取消'
  1088. });
  1089. });
  1090. },
  1091. // 请核
  1092. pleaseCheck() {
  1093. this.$refs['form'].validate((valid, done) => {
  1094. done()
  1095. if (valid) {
  1096. this.$confirm('是否确认请核?', '提示', {
  1097. confirmButtonText: '确定',
  1098. cancelButtonText: '取消',
  1099. type: 'warning'
  1100. }).then(() => {
  1101. if (new Date(this.form.deadlineTime) < new Date()) return this.$message.error("截止日期不能小于等于当前日期")
  1102. let form = {
  1103. ...this.form,
  1104. itemsList: this.dataListBox,
  1105. agentList: this.dataListAgent,
  1106. contrastList: this.dataListBid
  1107. }
  1108. this.fullscreenLoading = true
  1109. const loading = this.$loading({
  1110. lock: true,
  1111. text: '发布中',
  1112. spinner: 'el-icon-loading',
  1113. background: 'rgba(255,255,255,0.7)'
  1114. });
  1115. saveSaveList(form).then(res => {
  1116. const data = {
  1117. id: res.data.data.id,
  1118. url: '/bidingDocument/issueTender/index',
  1119. pageStatus: "this.$store.getters.entranceXsStatus"
  1120. }
  1121. confirmPleaseCheck(data).then(res => {
  1122. this.fullscreenLoading = false
  1123. this.$message({
  1124. type: 'success',
  1125. message: '请核成功!'
  1126. });
  1127. loading.close();
  1128. this.refreshData(this.form.id)
  1129. })
  1130. }).catch(() => {
  1131. loading.close();
  1132. this.fullscreenLoading = false;
  1133. })
  1134. }).catch(() => {
  1135. this.$message({
  1136. type: 'info',
  1137. message: '已取消'
  1138. });
  1139. });
  1140. } else {
  1141. done()
  1142. }
  1143. })
  1144. },
  1145. // 复制新增
  1146. copyNew() {
  1147. this.$confirm('是否确认复制新增?', '提示', {
  1148. confirmButtonText: '确定',
  1149. cancelButtonText: '取消',
  1150. type: 'warning'
  1151. }).then(() => {
  1152. this.form.status = 0
  1153. this.form.id = ''
  1154. this.dataListBid = []
  1155. this.dataListBox.forEach(item => item.id = '')
  1156. this.dataListAgent.forEach(item => item.id = '')
  1157. this.$set(this.optionForm, 'disabled', false)
  1158. this.$set(this.optionBox, 'addRowBtn', true)
  1159. this.$set(this.optionAgent, 'addRowBtn', true)
  1160. this.optionBox.column.forEach(item => {
  1161. this.$set(item, 'disabled', false)
  1162. })
  1163. this.optionAgent.column.forEach(item => {
  1164. this.$set(item, 'disabled', false)
  1165. })
  1166. }).catch(() => {
  1167. this.$message({
  1168. type: 'info',
  1169. message: '已取消'
  1170. });
  1171. });
  1172. },
  1173. // 作废
  1174. toVoid() {
  1175. this.$confirm('是否确认作废?', '提示', {
  1176. confirmButtonText: '确定',
  1177. cancelButtonText: '取消',
  1178. type: 'warning'
  1179. }).then(() => {
  1180. confirmVoid({id: this.form.id}).then(res => {
  1181. this.$message({
  1182. type: 'success',
  1183. message: '作废成功!'
  1184. });
  1185. this.refreshData(this.form.id)
  1186. })
  1187. }).catch(() => {
  1188. this.$message({
  1189. type: 'info',
  1190. message: '已取消'
  1191. });
  1192. });
  1193. },
  1194. // 发布
  1195. release() {
  1196. this.$confirm('是否确认发布?', '提示', {
  1197. confirmButtonText: '确定',
  1198. cancelButtonText: '取消',
  1199. type: 'warning'
  1200. }).then(() => {
  1201. const loading = this.$loading({
  1202. lock: true,
  1203. text: '发布中',
  1204. spinner: 'el-icon-loading',
  1205. background: 'rgba(255,255,255,0.7)'
  1206. });
  1207. confirmRelease({id: this.form.id}).then(res => {
  1208. loading.close();
  1209. this.$message({
  1210. type: 'success',
  1211. message: '发布成功!'
  1212. });
  1213. this.refreshData(this.form.id)
  1214. }).catch(() => {
  1215. loading.close();
  1216. })
  1217. }).catch(() => {
  1218. this.$message({
  1219. type: 'info',
  1220. message: '已取消'
  1221. });
  1222. });
  1223. },
  1224. // 保存
  1225. storage() {
  1226. let form = {
  1227. ...this.form,
  1228. itemsList: this.dataListBox,
  1229. agentList: this.dataListAgent,
  1230. contrastList: this.dataListBid
  1231. }
  1232. this.fullscreenLoading = true
  1233. saveSaveList(form).then(res => {
  1234. this.refreshData(res.data.data.id)
  1235. }).finally(() => {
  1236. this.fullscreenLoading = false
  1237. })
  1238. },
  1239. refreshData(id) {
  1240. let ids = ''
  1241. if (id) {
  1242. ids = id
  1243. } else {
  1244. ids = this.form.id
  1245. }
  1246. this.fullscreenLoading = true
  1247. detailDelegationList({id: ids}).then(res => {
  1248. this.form = res.data.data
  1249. this.dataListBox = this.form.itemsList
  1250. this.dataListAgent = this.form.agentList
  1251. this.dataListBid = this.form.contrastList
  1252. delete this.form.itemsList
  1253. delete this.form.agentList
  1254. delete this.form.contrastList
  1255. this.fullscreenLoading = false
  1256. })
  1257. },
  1258. }
  1259. }
  1260. </script>
  1261. <style scoped lang="scss">
  1262. ::v-deep .el-form-item {
  1263. margin-bottom: 8px;
  1264. }
  1265. </style>