detailsPageEdit.vue 34 KB

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