detailsPageEdit.vue 32 KB

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