detailsPageEdit.vue 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232
  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="primary" size="small" @click.native="copyNew()" :disabled="!form.id">复制新增</el-button>
  16. <el-button type="success" size="small" @click="release()" :disabled="form.status !== 0">发布
  17. </el-button>
  18. <el-button type="warning" size="small" @click="toVoid()" :disabled="form.status !== 4">取消发布
  19. </el-button>
  20. <el-button type="primary" size="small" @click="storage()">保存</el-button>
  21. </div>
  22. <div class="el-button&#45;&#45;small-yh add-customer-btn" v-else>
  23. <el-button type="success" size="small" @click="release()" :disabled="form.status !== 3">发布
  24. </el-button>
  25. <el-button type="warning" size="small" @click="pleaseCheck()" :disabled="form.status !== 0">请核
  26. </el-button>
  27. <el-button type="warning" size="small" @click.stop="checkDialog = true,checkData = detailData.check"
  28. v-if="checkDisabled">审批
  29. </el-button>
  30. <el-button type="primary" size="small" @click="storage()">保存</el-button>
  31. <el-dropdown style="margin-left: 10px">
  32. <el-button type="primary" size="small">
  33. 业务处理<i class="el-icon-arrow-down el-icon--right"></i>
  34. </el-button>
  35. <el-dropdown-menu slot="dropdown">
  36. <el-dropdown-item @click.native="copyNew()" :disabled="!form.id">复制新增</el-dropdown-item>
  37. <el-dropdown-item @click.native="toVoid()" :disabled="form.status < 4 || !form.status">
  38. 取消发布
  39. </el-dropdown-item>
  40. <el-dropdown-item @click.native="checkScheduleDialog = true,checkId=form.id"
  41. :disabled="form.status < 0 || !form.status">审批流程
  42. </el-dropdown-item>
  43. </el-dropdown-menu>
  44. </el-dropdown>
  45. </div>
  46. </div>
  47. </div>
  48. <trade-card title="基础资料" style="margin-top: 50px">
  49. <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
  50. </trade-card>
  51. <trade-card title="箱信息">
  52. <avue-crud ref="crudBox" :key="key" :option="optionBox" :data="dataListBox"
  53. @resetColumn="resetColumn('crudBox','optionBox','optionBoxTwo',201.1)"
  54. @saveColumn="saveColumn('crudBox','optionBox','optionBoxTwo',201.1)">
  55. <template slot-scope="{row,index}" slot="menu">
  56. <el-button
  57. type="text"
  58. size="small"
  59. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  60. @click="edit(row)"
  61. >{{ row.$cellEdit ? '确 认' : '编 辑' }}
  62. </el-button>
  63. <el-button
  64. type="text"
  65. size="small"
  66. icon="el-icon-delete"
  67. v-if="form.status === 0 || !form.status"
  68. @click="rowDel(row,index,'box')"
  69. >删 除
  70. </el-button>
  71. </template>
  72. </avue-crud>
  73. </trade-card>
  74. <trade-card title="代理信息">
  75. <avue-crud ref="crudAgent" :key="key" :option="optionAgent" :data="dataListAgent" @row-update="rowUpdate"
  76. @row-save="rowSave"
  77. @resetColumn="resetColumn('crudAgent','optionAgent','optionAgentTwo',201.2)"
  78. @saveColumn="saveColumn('crudAgent','optionAgent','optionAgentTwo',201.2)">
  79. <template slot-scope="{row,index}" slot="menu">
  80. <el-button
  81. type="text"
  82. size="small"
  83. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  84. @click="edit(row,index,false)"
  85. >{{ row.$cellEdit ? '确 认' : '编 辑' }}
  86. </el-button>
  87. <el-button
  88. type="text"
  89. size="small"
  90. icon="el-icon-delete"
  91. v-if="form.status === 0 || !form.status"
  92. @click="rowDel(row,index,'agent')"
  93. >删 除
  94. </el-button>
  95. </template>
  96. <template slot="menuLeft">
  97. <el-button
  98. type="success"
  99. size="small"
  100. icon="el-icon-bottom"
  101. @click="dialogVisible = true"
  102. >导入
  103. </el-button>
  104. </template>
  105. </avue-crud>
  106. </trade-card>
  107. <trade-card title="投标对比">
  108. <avue-crud ref="crudBid" :key="key" :option="optionBid" :data="dataListBid"
  109. @resetColumn="resetColumn('crudBid','optionBid','optionBidTwo',201.3)"
  110. @saveColumn="saveColumn('crudBid','optionBid','optionBidTwo',201.3)">
  111. <template slot-scope="{row,index}" slot="menu">
  112. <el-button
  113. type="text"
  114. size="small"
  115. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  116. @click="edit(row)"
  117. >{{ row.$cellEdit ? '确 认' : '编 辑' }}
  118. </el-button>
  119. <el-button
  120. type="text"
  121. size="small"
  122. @click="winningTheBid(row,index)"
  123. v-if="row.status === 5"
  124. >确认中标
  125. </el-button>
  126. </template>
  127. </avue-crud>
  128. </trade-card>
  129. <el-dialog
  130. v-dialogdrag
  131. title="导入客户"
  132. :fullscreen="dialogFull"
  133. :visible.sync="dialogVisible"
  134. class="el-dialogDeep"
  135. append-to-body
  136. :close-on-click-modal="false"
  137. width="80%"
  138. >
  139. <template slot="title">
  140. <span class="el-dialog__title">
  141. <span
  142. style="display:inline-block;background-color: #3478f5;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"
  143. ></span>
  144. 导入客户
  145. </span>
  146. <div
  147. style="float: right"
  148. class="avue-crud__dialog__menu"
  149. @click="dialogFull ? (dialogFull = false) : (dialogFull = true)">
  150. <i class="el-icon-full-screen"></i>
  151. </div>
  152. </template>
  153. <el-row style="height: 0">
  154. <el-col :span="5">
  155. <div class="box">
  156. <el-scrollbar>
  157. <basic-container>
  158. <avue-tree
  159. :option="treeOption"
  160. :data="treeData"
  161. @node-click="nodeClick"
  162. />
  163. </basic-container>
  164. </el-scrollbar>
  165. </div>
  166. </el-col>
  167. <el-col :span="19">
  168. <basic-container>
  169. <avue-crud
  170. :option="option"
  171. :data="dataList"
  172. ref="crud"
  173. v-model="form"
  174. :page.sync="page"
  175. :before-close="beforeClose"
  176. @search-change="searchChange"
  177. @search-reset="searchReset"
  178. @refresh-change="refreshChange"
  179. @selection-change="selectionChange"
  180. @on-load="onLoad"
  181. @saveColumn="saveColumn('crud','option','option',47)"
  182. @tree-load="treeLoad"
  183. >
  184. </avue-crud>
  185. </basic-container>
  186. </el-col>
  187. </el-row>
  188. <span slot="footer" class="dialog-footer">
  189. <el-button @click="dialogVisible = false">取 消</el-button>
  190. <el-button
  191. type="primary"
  192. @click="confirmSelection"
  193. :disabled="selection.length > 0 ? false : true"
  194. >确 定</el-button>
  195. </span>
  196. </el-dialog>
  197. <el-dialog
  198. append-to-body
  199. title="审批"
  200. class="el-dialogDeep"
  201. :visible.sync="checkDialog"
  202. width="50%"
  203. :close-on-click-modal="false"
  204. :destroy-on-close="true"
  205. :close-on-press-escape="false"
  206. v-dialog-drag
  207. >
  208. <check
  209. :checkData="checkData"
  210. :checkDetail="false"
  211. :idList="[]"
  212. @choceCheckFun="checkDialog = false"
  213. >
  214. </check>
  215. </el-dialog>
  216. <el-dialog
  217. append-to-body
  218. title="审批进度"
  219. class="el-dialogDeep"
  220. :visible.sync="checkScheduleDialog"
  221. width="40%"
  222. :close-on-click-modal="false"
  223. :destroy-on-close="true"
  224. :close-on-press-escape="false"
  225. v-dialog-drag
  226. >
  227. <check-schedule
  228. :checkId="checkId"
  229. :batchNo="batchNo"
  230. @choceScheduleFun="checkScheduleDialog = false"
  231. >
  232. </check-schedule>
  233. </el-dialog>
  234. </div>
  235. </template>
  236. <script>
  237. import {
  238. detailDelegationList,
  239. saveSaveList,
  240. boxDelete,
  241. agentDelete,
  242. confirmRelease, confirmVoid, confirmPleaseCheck, confirmWinningTheBid, allList, paramList, corpByAttnList
  243. } from "@/api/bidingDocument/issueTender";
  244. import check from "@/components/check/check";
  245. import checkSchedule from "@/components/check/checkSchedule";
  246. import {dateFormat} from "@/util/date";
  247. import option from "@/components/selectComponent/configuration/mainList.json";
  248. import {customerList, getDeptLazyTree} from "@/api/basicData/customerInformation";
  249. import {customerParameter} from "@/enums/management-type";
  250. import {getDictionary} from "@/api/system/dictbiz";
  251. export default {
  252. name: "detailsPageEdit",
  253. components: {
  254. check,
  255. checkSchedule
  256. },
  257. watch: {
  258. form: {
  259. handler(newValue, oldValue) {
  260. if (this.form.status > 0) {
  261. this.$set(this.optionForm, 'disabled', true)
  262. this.$set(this.optionBox, 'addRowBtn', false)
  263. this.$set(this.optionAgent, 'addRowBtn', false)
  264. this.optionBox.column.forEach(item => {
  265. this.$set(item, 'disabled', true)
  266. if (item.prop === "remark") {
  267. this.$set(item, 'disabled', false)
  268. }
  269. })
  270. this.optionAgent.column.forEach(item => {
  271. this.$set(item, 'disabled', true)
  272. if (item.prop === "remark") {
  273. this.$set(item, 'disabled', false)
  274. }
  275. })
  276. } else {
  277. this.$set(this.optionForm, 'disabled', false)
  278. this.findObject(this.optionForm.column, "status").disabled = true
  279. this.$set(this.optionBox, 'disabled', false)
  280. if (this.optionBox.column) {
  281. this.findObject(this.optionBox.column, "status").disabled = true
  282. }
  283. this.$set(this.optionAgent, 'disabled', false)
  284. if (this.optionAgent.column) {
  285. this.findObject(this.optionAgent.column, "status").disabled = true
  286. }
  287. }
  288. },
  289. data() {
  290. return {
  291. dialogVisible: false,
  292. option: {},
  293. treeOption: {
  294. nodeKey: "id",
  295. lazy: true,
  296. treeLoad: function (node, resolve) {
  297. const parentId = node.level === 0 ? 0 : node.data.id;
  298. getDeptLazyTree({
  299. parentId: parentId,
  300. corpType: customerParameter.code
  301. }).then(res => {
  302. resolve(
  303. res.data.data.map(item => {
  304. return {
  305. ...item,
  306. leaf: !item.hasChildren
  307. };
  308. })
  309. );
  310. });
  311. },
  312. addBtn: false,
  313. menu: false,
  314. size: "small",
  315. props: {
  316. labelText: "标题",
  317. label: "title",
  318. value: "value",
  319. children: "children"
  320. }
  321. },
  322. dataList: [],
  323. page: {
  324. pageSize: 10,
  325. pagerCount: 5,
  326. total: 0
  327. },
  328. dialogFull: false,
  329. checkDialog: false,
  330. checkScheduleDialog: false,
  331. checkId: '',
  332. batchNo: '',
  333. line: '',
  334. key: 0,
  335. selection: [],
  336. checkData: {},
  337. fullscreenLoading: false,
  338. optionForm: {
  339. submitBtn: false,
  340. emptyBtn: false,
  341. span: 6,
  342. column: [{
  343. label: '发布日期',
  344. prop: 'releaseTime',
  345. type: "datetime",
  346. format: 'yyyy-MM-dd HH:mm',
  347. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  348. value: dateFormat(new Date, 'yyyy-MM-dd hh:mm:ss'),
  349. rules: [{
  350. required: true,
  351. message: " ",
  352. trigger: "change"
  353. }],
  354. }, {
  355. label: '截止日期',
  356. prop: 'deadlineTime',
  357. type: "datetime",
  358. format: 'yyyy-MM-dd HH:mm',
  359. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  360. rules: [{
  361. required: true,
  362. message: " ",
  363. trigger: "change"
  364. }],
  365. }, {
  366. label: '合同号',
  367. prop: 'contractNo',
  368. rules: [{
  369. required: true,
  370. message: " ",
  371. trigger: "change"
  372. }],
  373. }, {
  374. label: '状态',
  375. disabled: true,
  376. prop: 'status',
  377. dataType: "number",
  378. type: 'select',
  379. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  380. props: {
  381. label: "dictValue",
  382. value: "dictKey"
  383. }
  384. }, {
  385. label: '起运港',
  386. prop: 'departureHarbor',
  387. filterable: true,
  388. type: "select",
  389. dicUrl: "/api/blade-client/port/allList",
  390. props: {
  391. label: "name",
  392. value: "name"
  393. },
  394. rules: [{
  395. required: true,
  396. message: " ",
  397. trigger: "change"
  398. }],
  399. }, {
  400. label: '目的港',
  401. prop: 'objectiveHarbor',
  402. filterable: true,
  403. type: "select",
  404. dicUrl: "/api/blade-client/port/allList",
  405. props: {
  406. label: "name",
  407. value: "name"
  408. },
  409. change: (data) => {
  410. allList().then(res => {
  411. for (let item of res.data.data) {
  412. if (data.value == item.name) {
  413. this.line = item.line
  414. }
  415. }
  416. })
  417. },
  418. rules: [{
  419. required: true,
  420. message: " ",
  421. trigger: "change"
  422. }],
  423. }, {
  424. label: '起运地',
  425. prop: 'departureLand',
  426. filterable: true,
  427. type: "select",
  428. dicUrl: "/api/blade-client/port/allList",
  429. props: {
  430. label: "name",
  431. value: "name"
  432. }
  433. }, {
  434. label: '目的地',
  435. prop: 'objectiveLand',
  436. filterable: true,
  437. type: "select",
  438. dicUrl: "/api/blade-client/port/allList",
  439. props: {
  440. label: "name",
  441. value: "name"
  442. }
  443. }, {
  444. label: '装柜日期',
  445. prop: 'loadingTime',
  446. type: "datetime",
  447. format: 'yyyy-MM-dd HH:mm',
  448. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  449. rules: [{
  450. required: true,
  451. message: " ",
  452. trigger: "change"
  453. }],
  454. }, {
  455. label: '是否直航',
  456. prop: 'directFlight',
  457. type: 'select',
  458. dicData: [{
  459. label: '是',
  460. value: 1
  461. }, {
  462. label: '否',
  463. value: 0
  464. }],
  465. value: 1,
  466. rules: [{
  467. required: true,
  468. message: " ",
  469. trigger: "change"
  470. }],
  471. }, {
  472. label: '转港',
  473. prop: 'transshipment',
  474. filterable: true,
  475. type: "select",
  476. dicUrl: "/api/blade-client/port/allList",
  477. props: {
  478. label: "name",
  479. value: "name"
  480. }
  481. }, {
  482. label: '运输方式',
  483. prop: 'transportType',
  484. type: 'select',
  485. dicUrl: "/api/blade-system/dict-biz/dictionary?code=mode_transport",
  486. props: {
  487. label: "dictValue",
  488. value: "dictValue"
  489. },
  490. value: "海运",
  491. rules: [{
  492. required: true,
  493. message: " ",
  494. trigger: "change"
  495. }],
  496. }, {
  497. label: '运输条款',
  498. prop: 'transportClause',
  499. value: "CY-CY",
  500. rules: [{
  501. required: true,
  502. message: " ",
  503. trigger: "change"
  504. }],
  505. }, {
  506. label: '件数',
  507. prop: 'number',
  508. value: 10,
  509. rules: [{
  510. required: true,
  511. message: " ",
  512. trigger: "change"
  513. }],
  514. }, {
  515. label: '包装',
  516. prop: 'packing',
  517. type: 'select',
  518. dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  519. props: {
  520. label: "dictValue",
  521. value: "dictValue"
  522. },
  523. value: "木箱",
  524. rules: [{
  525. required: true,
  526. message: " ",
  527. trigger: "change"
  528. }],
  529. }, {
  530. label: '重量(kgs)',
  531. prop: 'weight',
  532. value: 27000,
  533. rules: [{
  534. required: true,
  535. message: " ",
  536. trigger: "change"
  537. }],
  538. }, {
  539. label: '尺码(cmb)',
  540. prop: 'size',
  541. value: 18,
  542. rules: [{
  543. required: true,
  544. message: " ",
  545. trigger: "change"
  546. }],
  547. }, {
  548. label: '货物信息',
  549. prop: 'cargoInformation',
  550. span: 18,
  551. value: "GLASS",
  552. rules: [{
  553. required: true,
  554. message: " ",
  555. trigger: "change"
  556. }],
  557. }, {
  558. label: '备注',
  559. prop: 'remark',
  560. type: 'textarea',
  561. span: 24,
  562. }]
  563. },
  564. optionBox: {},
  565. optionBoxTwo: {
  566. align: 'center',
  567. index: true,
  568. refreshBtn: false,
  569. addBtn: false,
  570. addRowBtn: true,
  571. cellBtn: false,
  572. editBtn: false,
  573. delBtn: false,
  574. column: [{
  575. label: '箱型',
  576. prop: 'boxType',
  577. cell: true,
  578. type: "select",
  579. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  580. props: {
  581. label: "dictValue",
  582. value: "dictValue"
  583. },
  584. index: 1,
  585. }, {
  586. label: '箱量',
  587. prop: 'boxAmount',
  588. cell: true,
  589. index: 2,
  590. },
  591. // {
  592. // label: '海运费',
  593. // prop: 'seaFreight',
  594. // cell: true,
  595. // index:3,
  596. // }, {
  597. // label: '起运港箱使费',
  598. // prop: 'departureHarborFee',
  599. // cell: true,
  600. // index:4,
  601. // }, {
  602. // label: '目的港箱使费',
  603. // prop: 'objectiveHarborFee',
  604. // cell: true,
  605. // index:5,
  606. // },
  607. {
  608. label: '状态',
  609. prop: 'status',
  610. type: 'select',
  611. dataType: "string",
  612. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  613. props: {
  614. label: "dictValue",
  615. value: "dictKey"
  616. },
  617. index: 6,
  618. }, {
  619. label: '备注',
  620. prop: 'remark',
  621. cell: true,
  622. index: 7,
  623. }]
  624. },
  625. optionAgent: {},
  626. optionAgentTwo: {
  627. align: 'center',
  628. index: true,
  629. refreshBtn: false,
  630. addBtn: false,
  631. addRowBtn: true,
  632. cellBtn: false,
  633. editBtn: false,
  634. delBtn: false,
  635. column: [{
  636. label: '名称',
  637. prop: 'agentId',
  638. filterable: true,
  639. cell: true,
  640. dicUrl: '/api/blade-client/corpsdesc/bidingCorpsList?corpsTypeName=货代',
  641. type: 'select',
  642. props: {
  643. label: "cname",
  644. value: "id"
  645. },
  646. cascader: ['contacts'],
  647. rules: [{
  648. required: true,
  649. message: " ",
  650. trigger: "change"
  651. }],
  652. index: 1,
  653. }, {
  654. label: '联系人',
  655. prop: 'contacts',
  656. cell: true,
  657. index: 2,
  658. type: 'select',
  659. dicUrl: `/api/blade-client/corpsattn/corpByAttnList?corpId={{agentId}}`,
  660. props: {
  661. label: 'cname',
  662. value: 'cname'
  663. },
  664. allowCreate: true,
  665. filterable: true,
  666. }, {
  667. label: '邮箱',
  668. prop: 'mailbox',
  669. cell: true,
  670. index: 3,
  671. }, {
  672. label: '电话',
  673. prop: 'phone',
  674. cell: true,
  675. index: 4,
  676. }, {
  677. label: '状态',
  678. prop: 'status',
  679. type: 'select',
  680. dataType: "string",
  681. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  682. props: {
  683. label: "dictValue",
  684. value: "dictKey"
  685. },
  686. index: 5,
  687. }, {
  688. label: '备注',
  689. prop: 'remark',
  690. cell: true,
  691. index: 6,
  692. }]
  693. },
  694. optionBid: {},
  695. optionBidTwo: {
  696. align: 'center',
  697. index: true,
  698. refreshBtn: false,
  699. addBtn: false,
  700. addRowBtn: false,
  701. cellBtn: false,
  702. editBtn: false,
  703. delBtn: false,
  704. menuWidth: 150,
  705. column: [{
  706. label: '名称',
  707. prop: 'contrastName',
  708. index: 1,
  709. }, {
  710. label: '箱型',
  711. prop: 'boxType',
  712. type: "select",
  713. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  714. props: {
  715. label: "dictValue",
  716. value: "dictValue"
  717. },
  718. index: 2,
  719. }, {
  720. label: '运费',
  721. prop: 'seaFreight',
  722. index: 3,
  723. },{
  724. label: '船公司',
  725. prop: 'shippingCompany',
  726. index: 4,
  727. }, {
  728. label: '目的港箱使天数',
  729. prop: 'objectiveHarborFee',
  730. index: 5,
  731. },{
  732. label: '船期',
  733. prop: 'shippingDate',
  734. index: 6,
  735. }, {
  736. label: '主单/分单',
  737. prop: 'documentType',
  738. index: 7,
  739. }, {
  740. label: '航程',
  741. prop: 'voyage',
  742. index: 8,
  743. }, {
  744. label: '亏舱费用',
  745. prop: 'brokenStowageAmount',
  746. index: 9,
  747. },{
  748. label: '截单时间',
  749. prop: 'cutOffTime',
  750. index: 10,
  751. },{
  752. label: '备注',
  753. prop: 'remark',
  754. cell: true,
  755. index: 11,
  756. },{
  757. label: '截港时间',
  758. prop: 'harborInterceptionTime',
  759. index: 12,
  760. }, {
  761. label: '竞价排名',
  762. prop: 'ranking',
  763. index: 13,
  764. }, {
  765. label: '起运港箱使天数',
  766. prop: 'departureHarborFee',
  767. index: 14,
  768. }, {
  769. label: '船名',
  770. prop: 'shipName',
  771. index: 15,
  772. }, {
  773. label: '状态',
  774. prop: 'status',
  775. type: 'select',
  776. dataType: "string",
  777. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  778. props: {
  779. label: "dictValue",
  780. value: "dictKey"
  781. },
  782. index: 16,
  783. }]
  784. },
  785. form: {},
  786. dataListBox: [],
  787. dataListAgent: [],
  788. dataListBid: [],
  789. param: {},
  790. checkDisabled: false
  791. }
  792. },
  793. props: {
  794. id: {
  795. type: String
  796. },
  797. detailData: {
  798. type: Object
  799. }
  800. },
  801. async created() {
  802. this.option = await this.getColumnData(this.getColumnName(47), option);
  803. this.optionBox = await this.getColumnData(this.getColumnName(201.1), this.optionBoxTwo);
  804. this.optionAgent = await this.getColumnData(this.getColumnName(201.2), this.optionAgentTwo);
  805. this.optionBid = await this.getColumnData(this.getColumnName(201.3), this.optionBidTwo);
  806. this.key++
  807. paramList({
  808. paramKey: "release.approval",
  809. current: 1,
  810. size: 10
  811. }).then(res => {
  812. for (let item of res.data.data.records) {
  813. if (item.paramKey === "release.approval") {
  814. this.param = item
  815. }
  816. }
  817. })
  818. if (this.id) {
  819. this.refreshData(this.id)
  820. }
  821. if (this.detailData.check) {
  822. this.checkDisabled = true
  823. this.batchNo = this.detailData.check.batchNo
  824. }
  825. this.findObject(this.optionAgent.column, "contacts").change = ({row,column,value}) => {
  826. corpByAttnList({corpId:row.agentId}).then(res=>{
  827. for (let item of res.data.data){
  828. if (item.cname == value){
  829. row.mailbox = item.email
  830. row.phone = item.tel
  831. }
  832. }
  833. })
  834. }
  835. this.findObject(this.optionAgent.column, "agentId").change = ({row, value, column}) => {
  836. for (let item of this.$refs.crudAgent.DIC[column.prop]){
  837. if (item.id == value){
  838. corpByAttnList({corpId:value}).then(res=>{
  839. if (res.data.data.length>0){
  840. console.log()
  841. row.contacts = res.data.data[0].cname
  842. row.mailbox = res.data.data[0].email
  843. row.phone = res.data.data[0].tel
  844. }
  845. })
  846. }
  847. }
  848. }
  849. },
  850. methods: {
  851. nodeClick(data) {
  852. this.treeDeptId = data.id;
  853. this.page.currentPage = 1;
  854. this.onLoad(this.page);
  855. },
  856. //确认导出触发
  857. confirmSelection() {
  858. for (let item of this.selection) {
  859. this.dataListAgent.push({
  860. $cellEdit: true,
  861. agentId: item.id,
  862. contacts: item.attn,
  863. phone: item.tel
  864. })
  865. }
  866. this.selection = [];
  867. this.dialogVisible = false;
  868. },
  869. //点击新增时触发
  870. beforeClose(done) {
  871. this.parentId = "";
  872. const column = this.findObject(this.option.column, "parentId");
  873. column.value = "";
  874. column.addDisabled = false;
  875. done();
  876. },
  877. //点击搜索按钮触发
  878. searchChange(params, done) {
  879. console.log(params);
  880. this.treeDeptId = "";
  881. this.page.currentPage = 1;
  882. this.onLoad(this.page, params);
  883. done();
  884. },
  885. //搜索重置按钮触发
  886. searchReset() {
  887. this.treeDeptId = "";
  888. this.onLoad(this.page);
  889. },
  890. //刷新触发
  891. refreshChange() {
  892. this.page = {
  893. pageSize: 10,
  894. pagerCount: 5,
  895. total: 0
  896. };
  897. },
  898. //选中触发
  899. selectionChange(selection) {
  900. this.selection = selection;
  901. },
  902. //树桩列点击展开触发
  903. treeLoad(tree, treeNode, resolve) {
  904. const parentId = tree.id;
  905. customerList({
  906. parentId: parentId,
  907. corpType: this.corpType ? this.corpType : "KH"
  908. }).then(res => {
  909. resolve(res.data.data.records);
  910. });
  911. },
  912. onLoad(page, params = {parentId: 0}) {
  913. let queryParams = Object.assign({}, params, {
  914. size: page.pageSize,
  915. current: page.currentPage,
  916. corpsTypeId: this.treeDeptId,
  917. corpType: this.corpType ? this.corpType : "KH",
  918. line: this.line
  919. });
  920. customerList(queryParams).then(res => {
  921. this.dataList = res.data.data.records;
  922. this.page.total = res.data.data.total;
  923. if (this.page.total) {
  924. this.option.height = window.innerHeight - 500;
  925. } else {
  926. this.option.height = window.innerHeight - 200;
  927. }
  928. });
  929. },
  930. //自定义列保存
  931. async saveColumn(ref, option, optionBack, code) {
  932. /**
  933. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  934. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  935. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  936. */
  937. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  938. if (inSave) {
  939. this.$message.success("保存成功");
  940. //关闭窗口
  941. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  942. }
  943. },
  944. //自定义列重置
  945. async resetColumn(ref, option, optionBack, code) {
  946. this[option] = this[optionBack];
  947. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  948. if (inSave) {
  949. this.$message.success("重置成功");
  950. if (this.form.status > 0) {
  951. this.$set(this.optionForm, 'disabled', true)
  952. this.$set(this.optionBox, 'addRowBtn', false)
  953. this.$set(this.optionAgent, 'addRowBtn', false)
  954. this.optionBox.column.forEach(item => {
  955. this.$set(item, 'disabled', true)
  956. if (item.prop === "remark") {
  957. this.$set(item, 'disabled', false)
  958. }
  959. })
  960. this.optionAgent.column.forEach(item => {
  961. this.$set(item, 'disabled', true)
  962. if (item.prop === "remark") {
  963. this.$set(item, 'disabled', false)
  964. }
  965. })
  966. } else {
  967. this.$set(this.optionForm, 'disabled', false)
  968. this.findObject(this.optionForm.column, "status").disabled = true
  969. this.$set(this.optionBox, 'disabled', false)
  970. this.findObject(this.optionBox.column, "status").disabled = true
  971. this.$set(this.optionAgent, 'disabled', false)
  972. this.findObject(this.optionAgent.column, "status").disabled = true
  973. }
  974. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  975. this.findObject(this.optionAgent.column, "contacts").change = ({row,column,value}) => {
  976. corpByAttnList({corpId:row.agentId}).then(res=>{
  977. for (let item of res.data.data){
  978. if (item.cname == value){
  979. row.mailbox = item.email
  980. row.phone = item.tel
  981. }
  982. }
  983. })
  984. }
  985. this.findObject(this.optionAgent.column, "agentId").change = ({row, value, column}) => {
  986. for (let item of this.$refs.crudAgent.DIC[column.prop]){
  987. if (item.id == value){
  988. corpByAttnList({corpId:value}).then(res=>{
  989. if (res.data.data.length>0){
  990. row.contacts = res.data.data[0].cname
  991. row.mailbox = res.data.data[0].email
  992. row.phone = res.data.data[0].tel
  993. }
  994. })
  995. }
  996. }
  997. }
  998. }
  999. },
  1000. edit(row, index, type = true) {
  1001. if (!type) {
  1002. this.$refs.crudAgent.rowCell(row, index)
  1003. } else {
  1004. if (row.$cellEdit) {
  1005. this.$set(row, '$cellEdit', false)
  1006. } else {
  1007. this.$set(row, '$cellEdit', true)
  1008. }
  1009. }
  1010. },
  1011. rowSave(form, done) {
  1012. done()
  1013. },
  1014. rowUpdate(form, index, done) {
  1015. done()
  1016. },
  1017. rowDel(row, index, type) {
  1018. this.$confirm('是否确认删除?', '提示', {
  1019. confirmButtonText: '确定',
  1020. cancelButtonText: '取消',
  1021. type: 'warning'
  1022. }).then(() => {
  1023. if (type === 'box') {
  1024. if (row.id) {
  1025. boxDelete({id: row.id}).then(res => {
  1026. this.dataListBox.splice(index, 1);
  1027. this.$message({
  1028. type: 'success',
  1029. message: '删除成功!'
  1030. });
  1031. })
  1032. } else {
  1033. this.dataListBox.splice(index, 1);
  1034. this.$message({
  1035. type: 'success',
  1036. message: '删除成功!'
  1037. });
  1038. }
  1039. } else if (type === 'agent') {
  1040. if (row.id) {
  1041. agentDelete({id: row.id}).then(res => {
  1042. this.dataListAgent.splice(index, 1);
  1043. this.$message({
  1044. type: 'success',
  1045. message: '删除成功!'
  1046. });
  1047. })
  1048. } else {
  1049. this.dataListAgent.splice(index, 1);
  1050. this.$message({
  1051. type: 'success',
  1052. message: '删除成功!'
  1053. });
  1054. }
  1055. }
  1056. }).catch(() => {
  1057. this.$message({
  1058. type: 'info',
  1059. message: '已取消'
  1060. });
  1061. });
  1062. },
  1063. backToList() {
  1064. this.$router.push({
  1065. path: '/bidingDocument/issueTender/index'
  1066. });
  1067. this.$emit('backToList', false)
  1068. },
  1069. // 确认中标
  1070. winningTheBid(row, index) {
  1071. this.$confirm('是否确认中标?', '提示', {
  1072. confirmButtonText: '确定',
  1073. cancelButtonText: '取消',
  1074. type: 'warning'
  1075. }).then(() => {
  1076. confirmWinningTheBid({id: row.id}).then(res => {
  1077. this.$message({
  1078. type: 'success',
  1079. message: '确认中标!'
  1080. });
  1081. this.refreshData(this.id)
  1082. })
  1083. }).catch(() => {
  1084. this.$message({
  1085. type: 'info',
  1086. message: '已取消'
  1087. });
  1088. });
  1089. },
  1090. // 请核
  1091. pleaseCheck() {
  1092. this.$refs['form'].validate((valid, done) => {
  1093. done()
  1094. if (valid) {
  1095. this.$confirm('是否确认请核?', '提示', {
  1096. confirmButtonText: '确定',
  1097. cancelButtonText: '取消',
  1098. type: 'warning'
  1099. }).then(() => {
  1100. if (new Date(this.form.deadlineTime) < new Date()) return this.$message.error("截止日期不能小于等于当前日期")
  1101. let form = {
  1102. ...this.form,
  1103. itemsList: this.dataListBox,
  1104. agentList: this.dataListAgent,
  1105. contrastList: this.dataListBid
  1106. }
  1107. this.fullscreenLoading = true
  1108. const loading = this.$loading({
  1109. lock: true,
  1110. text: '发布中',
  1111. spinner: 'el-icon-loading',
  1112. background: 'rgba(255,255,255,0.7)'
  1113. });
  1114. saveSaveList(form).then(res => {
  1115. const data = {
  1116. id: res.data.data.id,
  1117. url: '/bidingDocument/issueTender/index',
  1118. pageStatus: "this.$store.getters.entranceXsStatus"
  1119. }
  1120. confirmPleaseCheck(data).then(res => {
  1121. this.fullscreenLoading = false
  1122. this.$message({
  1123. type: 'success',
  1124. message: '请核成功!'
  1125. });
  1126. loading.close();
  1127. this.refreshData(this.form.id)
  1128. })
  1129. }).catch(() => {
  1130. loading.close();
  1131. this.fullscreenLoading = false;
  1132. })
  1133. }).catch(() => {
  1134. this.$message({
  1135. type: 'info',
  1136. message: '已取消'
  1137. });
  1138. });
  1139. } else {
  1140. done()
  1141. }
  1142. })
  1143. },
  1144. // 复制新增
  1145. copyNew() {
  1146. this.$confirm('是否确认复制新增?', '提示', {
  1147. confirmButtonText: '确定',
  1148. cancelButtonText: '取消',
  1149. type: 'warning'
  1150. }).then(() => {
  1151. this.form.status = 0
  1152. this.form.id = ''
  1153. this.dataListBid = []
  1154. this.dataListBox.forEach(item => item.id = '')
  1155. this.dataListAgent.forEach(item => item.id = '')
  1156. this.$set(this.optionForm, 'disabled', false)
  1157. this.$set(this.optionBox, 'addRowBtn', true)
  1158. this.$set(this.optionAgent, 'addRowBtn', true)
  1159. this.optionBox.column.forEach(item => {
  1160. this.$set(item, 'disabled', false)
  1161. })
  1162. this.optionAgent.column.forEach(item => {
  1163. this.$set(item, 'disabled', false)
  1164. })
  1165. }).catch(() => {
  1166. this.$message({
  1167. type: 'info',
  1168. message: '已取消'
  1169. });
  1170. });
  1171. },
  1172. // 作废
  1173. toVoid() {
  1174. this.$confirm('是否确认作废?', '提示', {
  1175. confirmButtonText: '确定',
  1176. cancelButtonText: '取消',
  1177. type: 'warning'
  1178. }).then(() => {
  1179. confirmVoid({id: this.form.id}).then(res => {
  1180. this.$message({
  1181. type: 'success',
  1182. message: '作废成功!'
  1183. });
  1184. this.refreshData(this.form.id)
  1185. })
  1186. }).catch(() => {
  1187. this.$message({
  1188. type: 'info',
  1189. message: '已取消'
  1190. });
  1191. });
  1192. },
  1193. // 发布
  1194. release() {
  1195. this.$confirm('是否确认发布?', '提示', {
  1196. confirmButtonText: '确定',
  1197. cancelButtonText: '取消',
  1198. type: 'warning'
  1199. }).then(() => {
  1200. const loading = this.$loading({
  1201. lock: true,
  1202. text: '发布中',
  1203. spinner: 'el-icon-loading',
  1204. background: 'rgba(255,255,255,0.7)'
  1205. });
  1206. confirmRelease({id: this.form.id}).then(res => {
  1207. loading.close();
  1208. this.$message({
  1209. type: 'success',
  1210. message: '发布成功!'
  1211. });
  1212. this.refreshData(this.form.id)
  1213. }).catch(() => {
  1214. loading.close();
  1215. })
  1216. }).catch(() => {
  1217. this.$message({
  1218. type: 'info',
  1219. message: '已取消'
  1220. });
  1221. });
  1222. },
  1223. // 保存
  1224. storage() {
  1225. let form = {
  1226. ...this.form,
  1227. itemsList: this.dataListBox,
  1228. agentList: this.dataListAgent,
  1229. contrastList: this.dataListBid
  1230. }
  1231. this.fullscreenLoading = true
  1232. saveSaveList(form).then(res => {
  1233. this.refreshData(res.data.data.id)
  1234. }).finally(() => {
  1235. this.fullscreenLoading = false
  1236. })
  1237. },
  1238. refreshData(id) {
  1239. let ids = ''
  1240. if (id) {
  1241. ids = id
  1242. } else {
  1243. ids = this.form.id
  1244. }
  1245. this.fullscreenLoading = true
  1246. detailDelegationList({id: ids}).then(res => {
  1247. this.form = res.data.data
  1248. this.dataListBox = this.form.itemsList
  1249. this.dataListAgent = this.form.agentList
  1250. this.dataListBid = this.form.contrastList
  1251. delete this.form.itemsList
  1252. delete this.form.agentList
  1253. delete this.form.contrastList
  1254. this.fullscreenLoading = false
  1255. })
  1256. },
  1257. }
  1258. }
  1259. },
  1260. data() {
  1261. return {
  1262. dialogVisible: false,
  1263. option: {},
  1264. treeOption: {
  1265. nodeKey: "id",
  1266. lazy: true,
  1267. treeLoad: function (node, resolve) {
  1268. const parentId = node.level === 0 ? 0 : node.data.id;
  1269. getDeptLazyTree({
  1270. parentId: parentId,
  1271. corpType: customerParameter.code
  1272. }).then(res => {
  1273. resolve(
  1274. res.data.data.map(item => {
  1275. return {
  1276. ...item,
  1277. leaf: !item.hasChildren
  1278. };
  1279. })
  1280. );
  1281. });
  1282. },
  1283. addBtn: false,
  1284. menu: false,
  1285. size: "small",
  1286. props: {
  1287. labelText: "标题",
  1288. label: "title",
  1289. value: "value",
  1290. children: "children"
  1291. }
  1292. },
  1293. dataList: [],
  1294. page: {
  1295. pageSize: 10,
  1296. pagerCount: 5,
  1297. total: 0
  1298. },
  1299. dialogFull: false,
  1300. checkDialog: false,
  1301. checkScheduleDialog: false,
  1302. checkId: '',
  1303. batchNo: '',
  1304. line: '',
  1305. key: 0,
  1306. selection: [],
  1307. checkData: {},
  1308. fullscreenLoading: false,
  1309. optionForm: {
  1310. submitBtn: false,
  1311. emptyBtn: false,
  1312. span: 6,
  1313. column: [{
  1314. label: '发布日期',
  1315. prop: 'releaseTime',
  1316. type: "datetime",
  1317. format: 'yyyy-MM-dd HH:mm',
  1318. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1319. value: dateFormat(new Date, 'yyyy-MM-dd hh:mm:ss'),
  1320. rules: [{
  1321. required: true,
  1322. message: " ",
  1323. trigger: "change"
  1324. }],
  1325. }, {
  1326. label: '截止日期',
  1327. prop: 'deadlineTime',
  1328. type: "datetime",
  1329. format: 'yyyy-MM-dd HH:mm',
  1330. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1331. rules: [{
  1332. required: true,
  1333. message: " ",
  1334. trigger: "change"
  1335. }],
  1336. }, {
  1337. label: '合同号',
  1338. prop: 'contractNo',
  1339. rules: [{
  1340. required: true,
  1341. message: " ",
  1342. trigger: "change"
  1343. }],
  1344. }, {
  1345. label: '状态',
  1346. disabled: true,
  1347. prop: 'status',
  1348. dataType: "number",
  1349. type: 'select',
  1350. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  1351. props: {
  1352. label: "dictValue",
  1353. value: "dictKey"
  1354. }
  1355. }, {
  1356. label: '起运港',
  1357. prop: 'departureHarbor',
  1358. filterable: true,
  1359. type: "select",
  1360. dicUrl: "/api/blade-client/port/allList",
  1361. props: {
  1362. label: "name",
  1363. value: "name"
  1364. },
  1365. rules: [{
  1366. required: true,
  1367. message: " ",
  1368. trigger: "change"
  1369. }],
  1370. }, {
  1371. label: '目的港',
  1372. prop: 'objectiveHarbor',
  1373. filterable: true,
  1374. type: "select",
  1375. dicUrl: "/api/blade-client/port/allList",
  1376. props: {
  1377. label: "name",
  1378. value: "name"
  1379. },
  1380. change: (data) => {
  1381. allList().then(res => {
  1382. for (let item of res.data.data) {
  1383. if (data.value == item.name) {
  1384. this.line = item.line
  1385. }
  1386. }
  1387. })
  1388. },
  1389. rules: [{
  1390. required: true,
  1391. message: " ",
  1392. trigger: "change"
  1393. }],
  1394. }, {
  1395. label: '起运地',
  1396. prop: 'departureLand',
  1397. filterable: true,
  1398. type: "select",
  1399. dicUrl: "/api/blade-client/port/allList",
  1400. props: {
  1401. label: "name",
  1402. value: "name"
  1403. }
  1404. }, {
  1405. label: '目的地',
  1406. prop: 'objectiveLand',
  1407. filterable: true,
  1408. type: "select",
  1409. dicUrl: "/api/blade-client/port/allList",
  1410. props: {
  1411. label: "name",
  1412. value: "name"
  1413. }
  1414. }, {
  1415. label: '装柜日期',
  1416. prop: 'loadingTime',
  1417. type: "datetime",
  1418. format: 'yyyy-MM-dd HH:mm',
  1419. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1420. rules: [{
  1421. required: true,
  1422. message: " ",
  1423. trigger: "change"
  1424. }],
  1425. }, {
  1426. label: '是否直航',
  1427. prop: 'directFlight',
  1428. type: 'select',
  1429. dicData: [{
  1430. label: '是',
  1431. value: 1
  1432. }, {
  1433. label: '否',
  1434. value: 0
  1435. }],
  1436. value: 1,
  1437. rules: [{
  1438. required: true,
  1439. message: " ",
  1440. trigger: "change"
  1441. }],
  1442. }, {
  1443. label: '转港',
  1444. prop: 'transshipment',
  1445. filterable: true,
  1446. type: "select",
  1447. dicUrl: "/api/blade-client/port/allList",
  1448. props: {
  1449. label: "name",
  1450. value: "name"
  1451. }
  1452. }, {
  1453. label: '运输方式',
  1454. prop: 'transportType',
  1455. type: 'select',
  1456. dicUrl: "/api/blade-system/dict-biz/dictionary?code=mode_transport",
  1457. props: {
  1458. label: "dictValue",
  1459. value: "dictValue"
  1460. },
  1461. value: "海运",
  1462. rules: [{
  1463. required: true,
  1464. message: " ",
  1465. trigger: "change"
  1466. }],
  1467. }, {
  1468. label: '运输条款',
  1469. prop: 'transportClause',
  1470. value: "CY-CY",
  1471. rules: [{
  1472. required: true,
  1473. message: " ",
  1474. trigger: "change"
  1475. }],
  1476. }, {
  1477. label: '件数',
  1478. prop: 'number',
  1479. value: 10,
  1480. rules: [{
  1481. required: true,
  1482. message: " ",
  1483. trigger: "change"
  1484. }],
  1485. }, {
  1486. label: '包装',
  1487. prop: 'packing',
  1488. type: 'select',
  1489. dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  1490. props: {
  1491. label: "dictValue",
  1492. value: "dictValue"
  1493. },
  1494. value: "木箱",
  1495. rules: [{
  1496. required: true,
  1497. message: " ",
  1498. trigger: "change"
  1499. }],
  1500. }, {
  1501. label: '重量(kgs)',
  1502. prop: 'weight',
  1503. value: 27000,
  1504. rules: [{
  1505. required: true,
  1506. message: " ",
  1507. trigger: "change"
  1508. }],
  1509. }, {
  1510. label: '尺码(cmb)',
  1511. prop: 'size',
  1512. value: 18,
  1513. rules: [{
  1514. required: true,
  1515. message: " ",
  1516. trigger: "change"
  1517. }],
  1518. }, {
  1519. label: '货物信息',
  1520. prop: 'cargoInformation',
  1521. span: 18,
  1522. value: "GLASS",
  1523. rules: [{
  1524. required: true,
  1525. message: " ",
  1526. trigger: "change"
  1527. }],
  1528. }, {
  1529. label: '备注',
  1530. prop: 'remark',
  1531. type: 'textarea',
  1532. span: 24,
  1533. }]
  1534. },
  1535. optionBox: {},
  1536. optionBoxTwo: {
  1537. align: 'center',
  1538. index: true,
  1539. refreshBtn: false,
  1540. addBtn: false,
  1541. addRowBtn: true,
  1542. cellBtn: false,
  1543. editBtn: false,
  1544. delBtn: false,
  1545. column: [{
  1546. label: '箱型',
  1547. prop: 'boxType',
  1548. cell: true,
  1549. type: "select",
  1550. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  1551. props: {
  1552. label: "dictValue",
  1553. value: "dictValue"
  1554. },
  1555. index: 1,
  1556. }, {
  1557. label: '箱量',
  1558. prop: 'boxAmount',
  1559. cell: true,
  1560. index: 2,
  1561. },
  1562. // {
  1563. // label: '海运费',
  1564. // prop: 'seaFreight',
  1565. // cell: true,
  1566. // index:3,
  1567. // }, {
  1568. // label: '起运港箱使费',
  1569. // prop: 'departureHarborFee',
  1570. // cell: true,
  1571. // index:4,
  1572. // }, {
  1573. // label: '目的港箱使费',
  1574. // prop: 'objectiveHarborFee',
  1575. // cell: true,
  1576. // index:5,
  1577. // },
  1578. {
  1579. label: '状态',
  1580. prop: 'status',
  1581. type: 'select',
  1582. dataType: "string",
  1583. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  1584. props: {
  1585. label: "dictValue",
  1586. value: "dictKey"
  1587. },
  1588. index: 6,
  1589. }, {
  1590. label: '备注',
  1591. prop: 'remark',
  1592. cell: true,
  1593. index: 7,
  1594. }]
  1595. },
  1596. optionAgent: {},
  1597. optionAgentTwo: {
  1598. align: 'center',
  1599. index: true,
  1600. refreshBtn: false,
  1601. addBtn: false,
  1602. addRowBtn: true,
  1603. cellBtn: false,
  1604. editBtn: false,
  1605. delBtn: false,
  1606. column: [{
  1607. label: '名称',
  1608. prop: 'agentId',
  1609. filterable: true,
  1610. cell: true,
  1611. dicUrl: '/api/blade-client/corpsdesc/bidingCorpsList?corpsTypeName=货代',
  1612. type: 'select',
  1613. props: {
  1614. label: "cname",
  1615. value: "id"
  1616. },
  1617. cascader: ['contacts'],
  1618. rules: [{
  1619. required: true,
  1620. message: " ",
  1621. trigger: "change"
  1622. }],
  1623. index: 1,
  1624. }, {
  1625. label: '联系人',
  1626. prop: 'contacts',
  1627. cell: true,
  1628. index: 2,
  1629. type: 'select',
  1630. dicUrl: `/api/blade-client/corpsattn/corpByAttnList?corpId={{agentId}}`,
  1631. props: {
  1632. label: 'cname',
  1633. value: 'cname'
  1634. },
  1635. allowCreate: true,
  1636. filterable: true,
  1637. }, {
  1638. label: '邮箱',
  1639. prop: 'mailbox',
  1640. cell: true,
  1641. index: 3,
  1642. }, {
  1643. label: '电话',
  1644. prop: 'phone',
  1645. cell: true,
  1646. index: 4,
  1647. }, {
  1648. label: '状态',
  1649. prop: 'status',
  1650. type: 'select',
  1651. dataType: "string",
  1652. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  1653. props: {
  1654. label: "dictValue",
  1655. value: "dictKey"
  1656. },
  1657. index: 5,
  1658. }, {
  1659. label: '备注',
  1660. prop: 'remark',
  1661. cell: true,
  1662. index: 6,
  1663. }]
  1664. },
  1665. optionBid: {},
  1666. optionBidTwo: {
  1667. align: 'center',
  1668. index: true,
  1669. refreshBtn: false,
  1670. addBtn: false,
  1671. addRowBtn: false,
  1672. cellBtn: false,
  1673. editBtn: false,
  1674. delBtn: false,
  1675. menuWidth: 140,
  1676. column: [{
  1677. label: '名称',
  1678. prop: 'contrastName',
  1679. index: 1,
  1680. }, {
  1681. label: '船公司',
  1682. prop: 'shippingCompany',
  1683. index: 2,
  1684. }, {
  1685. label: '船名',
  1686. prop: 'shipName',
  1687. index: 3,
  1688. }, {
  1689. label: '箱型',
  1690. prop: 'boxType',
  1691. type: "select",
  1692. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  1693. props: {
  1694. label: "dictValue",
  1695. value: "dictValue"
  1696. },
  1697. index: 4,
  1698. }, {
  1699. label: '运费',
  1700. prop: 'seaFreight',
  1701. index: 5,
  1702. }, {
  1703. label: '截单时间',
  1704. prop: 'cutOffTime',
  1705. index: 6,
  1706. }, {
  1707. label: '截港时间',
  1708. prop: 'harborInterceptionTime',
  1709. index: 7,
  1710. }, {
  1711. label: '船期',
  1712. prop: 'shippingDate',
  1713. index: 8,
  1714. }, {
  1715. label: '起运港箱使天数',
  1716. prop: 'departureHarborFee',
  1717. index: 9,
  1718. }, {
  1719. label: '目的港箱使天数',
  1720. prop: 'objectiveHarborFee',
  1721. index: 10,
  1722. }, {
  1723. label: '状态',
  1724. prop: 'status',
  1725. type: 'select',
  1726. dataType: "string",
  1727. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  1728. props: {
  1729. label: "dictValue",
  1730. value: "dictKey"
  1731. },
  1732. index: 11,
  1733. }, {
  1734. label: '备注',
  1735. prop: 'remark',
  1736. cell: true,
  1737. index: 12,
  1738. }]
  1739. },
  1740. form: {},
  1741. dataListBox: [],
  1742. dataListAgent: [],
  1743. dataListBid: [],
  1744. param: {},
  1745. checkDisabled: false
  1746. }
  1747. },
  1748. props: {
  1749. id: {
  1750. type: String
  1751. },
  1752. detailData: {
  1753. type: Object
  1754. }
  1755. },
  1756. async created() {
  1757. this.option = await this.getColumnData(this.getColumnName(47), option);
  1758. this.optionBox = await this.getColumnData(this.getColumnName(201.1), this.optionBoxTwo);
  1759. this.optionAgent = await this.getColumnData(this.getColumnName(201.2), this.optionAgentTwo);
  1760. this.optionBid = await this.getColumnData(this.getColumnName(201.3), this.optionBidTwo);
  1761. this.key++
  1762. paramList({
  1763. paramKey: "release.approval",
  1764. current: 1,
  1765. size: 10
  1766. }).then(res => {
  1767. for (let item of res.data.data.records) {
  1768. if (item.paramKey === "release.approval") {
  1769. this.param = item
  1770. }
  1771. }
  1772. })
  1773. if (this.id) {
  1774. this.refreshData(this.id)
  1775. }
  1776. if (this.detailData.check) {
  1777. this.checkDisabled = true
  1778. this.batchNo = this.detailData.check.batchNo
  1779. }
  1780. this.findObject(this.optionAgent.column, "contacts").change = ({row, column, value}) => {
  1781. corpByAttnList({corpId: row.agentId}).then(res => {
  1782. for (let item of res.data.data) {
  1783. if (item.cname == value) {
  1784. row.mailbox = item.email
  1785. row.phone = item.tel
  1786. }
  1787. }
  1788. })
  1789. }
  1790. this.findObject(this.optionAgent.column, "agentId").change = ({row, value, column}) => {
  1791. for (let item of this.$refs.crudAgent.DIC[column.prop]) {
  1792. if (item.id == value) {
  1793. corpByAttnList({corpId: value}).then(res => {
  1794. if (res.data.data.length > 0) {
  1795. console.log()
  1796. row.contacts = res.data.data[0].cname
  1797. row.mailbox = res.data.data[0].email
  1798. row.phone = res.data.data[0].tel
  1799. }
  1800. })
  1801. }
  1802. }
  1803. }
  1804. },
  1805. methods: {
  1806. nodeClick(data) {
  1807. this.treeDeptId = data.id;
  1808. this.page.currentPage = 1;
  1809. this.onLoad(this.page);
  1810. },
  1811. //确认导出触发
  1812. confirmSelection() {
  1813. for (let item of this.selection) {
  1814. this.dataListAgent.push({
  1815. $cellEdit: true,
  1816. agentId: item.id,
  1817. contacts: item.attn,
  1818. phone: item.tel
  1819. })
  1820. }
  1821. this.selection = [];
  1822. this.dialogVisible = false;
  1823. },
  1824. //点击新增时触发
  1825. beforeClose(done) {
  1826. this.parentId = "";
  1827. const column = this.findObject(this.option.column, "parentId");
  1828. column.value = "";
  1829. column.addDisabled = false;
  1830. done();
  1831. },
  1832. //点击搜索按钮触发
  1833. searchChange(params, done) {
  1834. console.log(params);
  1835. this.treeDeptId = "";
  1836. this.page.currentPage = 1;
  1837. this.onLoad(this.page, params);
  1838. done();
  1839. },
  1840. //搜索重置按钮触发
  1841. searchReset() {
  1842. this.treeDeptId = "";
  1843. this.onLoad(this.page);
  1844. },
  1845. //刷新触发
  1846. refreshChange() {
  1847. this.page = {
  1848. pageSize: 10,
  1849. pagerCount: 5,
  1850. total: 0
  1851. };
  1852. },
  1853. //选中触发
  1854. selectionChange(selection) {
  1855. this.selection = selection;
  1856. },
  1857. //树桩列点击展开触发
  1858. treeLoad(tree, treeNode, resolve) {
  1859. const parentId = tree.id;
  1860. customerList({
  1861. parentId: parentId,
  1862. corpType: this.corpType ? this.corpType : "KH"
  1863. }).then(res => {
  1864. resolve(res.data.data.records);
  1865. });
  1866. },
  1867. onLoad(page, params = {parentId: 0}) {
  1868. let queryParams = Object.assign({}, params, {
  1869. size: page.pageSize,
  1870. current: page.currentPage,
  1871. corpsTypeId: this.treeDeptId,
  1872. corpType: this.corpType ? this.corpType : "KH",
  1873. line: this.line
  1874. });
  1875. customerList(queryParams).then(res => {
  1876. this.dataList = res.data.data.records;
  1877. this.page.total = res.data.data.total;
  1878. if (this.page.total) {
  1879. this.option.height = window.innerHeight - 500;
  1880. } else {
  1881. this.option.height = window.innerHeight - 200;
  1882. }
  1883. });
  1884. },
  1885. //自定义列保存
  1886. async saveColumn(ref, option, optionBack, code) {
  1887. /**
  1888. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1889. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1890. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1891. */
  1892. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1893. if (inSave) {
  1894. this.$message.success("保存成功");
  1895. //关闭窗口
  1896. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1897. }
  1898. },
  1899. //自定义列重置
  1900. async resetColumn(ref, option, optionBack, code) {
  1901. this[option] = this[optionBack];
  1902. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1903. if (inSave) {
  1904. this.$message.success("重置成功");
  1905. if (this.form.status > 0) {
  1906. this.$set(this.optionForm, 'disabled', true)
  1907. this.$set(this.optionBox, 'addRowBtn', false)
  1908. this.$set(this.optionAgent, 'addRowBtn', false)
  1909. this.optionBox.column.forEach(item => {
  1910. this.$set(item, 'disabled', true)
  1911. if (item.prop === "remark") {
  1912. this.$set(item, 'disabled', false)
  1913. }
  1914. })
  1915. this.optionAgent.column.forEach(item => {
  1916. this.$set(item, 'disabled', true)
  1917. if (item.prop === "remark") {
  1918. this.$set(item, 'disabled', false)
  1919. }
  1920. })
  1921. } else {
  1922. this.$set(this.optionForm, 'disabled', false)
  1923. this.findObject(this.optionForm.column, "status").disabled = true
  1924. this.$set(this.optionBox, 'disabled', false)
  1925. this.findObject(this.optionBox.column, "status").disabled = true
  1926. this.$set(this.optionAgent, 'disabled', false)
  1927. this.findObject(this.optionAgent.column, "status").disabled = true
  1928. }
  1929. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1930. this.findObject(this.optionAgent.column, "contacts").change = ({row, column, value}) => {
  1931. corpByAttnList({corpId: row.agentId}).then(res => {
  1932. for (let item of res.data.data) {
  1933. if (item.cname == value) {
  1934. row.mailbox = item.email
  1935. row.phone = item.tel
  1936. }
  1937. }
  1938. })
  1939. }
  1940. this.findObject(this.optionAgent.column, "agentId").change = ({row, value, column}) => {
  1941. for (let item of this.$refs.crudAgent.DIC[column.prop]) {
  1942. if (item.id == value) {
  1943. corpByAttnList({corpId: value}).then(res => {
  1944. if (res.data.data.length > 0) {
  1945. row.contacts = res.data.data[0].cname
  1946. row.mailbox = res.data.data[0].email
  1947. row.phone = res.data.data[0].tel
  1948. }
  1949. })
  1950. }
  1951. }
  1952. }
  1953. }
  1954. },
  1955. edit(row, index, type = true) {
  1956. if (!type) {
  1957. this.$refs.crudAgent.rowCell(row, index)
  1958. } else {
  1959. if (row.$cellEdit) {
  1960. this.$set(row, '$cellEdit', false)
  1961. } else {
  1962. this.$set(row, '$cellEdit', true)
  1963. }
  1964. }
  1965. },
  1966. rowSave(form, done) {
  1967. done()
  1968. },
  1969. rowUpdate(form, index, done) {
  1970. done()
  1971. },
  1972. rowDel(row, index, type) {
  1973. this.$confirm('是否确认删除?', '提示', {
  1974. confirmButtonText: '确定',
  1975. cancelButtonText: '取消',
  1976. type: 'warning'
  1977. }).then(() => {
  1978. if (type === 'box') {
  1979. if (row.id) {
  1980. boxDelete({id: row.id}).then(res => {
  1981. this.dataListBox.splice(index, 1);
  1982. this.$message({
  1983. type: 'success',
  1984. message: '删除成功!'
  1985. });
  1986. })
  1987. } else {
  1988. this.dataListBox.splice(index, 1);
  1989. this.$message({
  1990. type: 'success',
  1991. message: '删除成功!'
  1992. });
  1993. }
  1994. } else if (type === 'agent') {
  1995. if (row.id) {
  1996. agentDelete({id: row.id}).then(res => {
  1997. this.dataListAgent.splice(index, 1);
  1998. this.$message({
  1999. type: 'success',
  2000. message: '删除成功!'
  2001. });
  2002. })
  2003. } else {
  2004. this.dataListAgent.splice(index, 1);
  2005. this.$message({
  2006. type: 'success',
  2007. message: '删除成功!'
  2008. });
  2009. }
  2010. }
  2011. }).catch(() => {
  2012. this.$message({
  2013. type: 'info',
  2014. message: '已取消'
  2015. });
  2016. });
  2017. },
  2018. backToList() {
  2019. this.$router.push({
  2020. path: '/bidingDocument/issueTender/index'
  2021. });
  2022. this.$emit('backToList', false)
  2023. },
  2024. // 确认中标
  2025. winningTheBid(row, index) {
  2026. this.$confirm('是否确认中标?', '提示', {
  2027. confirmButtonText: '确定',
  2028. cancelButtonText: '取消',
  2029. type: 'warning'
  2030. }).then(() => {
  2031. confirmWinningTheBid({id: row.id}).then(res => {
  2032. this.$message({
  2033. type: 'success',
  2034. message: '确认中标!'
  2035. });
  2036. this.refreshData(this.id)
  2037. })
  2038. }).catch(() => {
  2039. this.$message({
  2040. type: 'info',
  2041. message: '已取消'
  2042. });
  2043. });
  2044. },
  2045. // 请核
  2046. pleaseCheck() {
  2047. this.$refs['form'].validate((valid, done) => {
  2048. done()
  2049. if (valid) {
  2050. this.$confirm('是否确认请核?', '提示', {
  2051. confirmButtonText: '确定',
  2052. cancelButtonText: '取消',
  2053. type: 'warning'
  2054. }).then(() => {
  2055. if (new Date(this.form.deadlineTime) < new Date()) return this.$message.error("截止日期不能小于等于当前日期")
  2056. let form = {
  2057. ...this.form,
  2058. itemsList: this.dataListBox,
  2059. agentList: this.dataListAgent,
  2060. contrastList: this.dataListBid
  2061. }
  2062. this.fullscreenLoading = true
  2063. const loading = this.$loading({
  2064. lock: true,
  2065. text: '发布中',
  2066. spinner: 'el-icon-loading',
  2067. background: 'rgba(255,255,255,0.7)'
  2068. });
  2069. saveSaveList(form).then(res => {
  2070. const data = {
  2071. id: res.data.data.id,
  2072. url: '/bidingDocument/issueTender/index',
  2073. pageStatus: "this.$store.getters.entranceXsStatus"
  2074. }
  2075. confirmPleaseCheck(data).then(res => {
  2076. this.fullscreenLoading = false
  2077. this.$message({
  2078. type: 'success',
  2079. message: '请核成功!'
  2080. });
  2081. loading.close();
  2082. this.refreshData(this.form.id)
  2083. })
  2084. }).catch(() => {
  2085. loading.close();
  2086. this.fullscreenLoading = false;
  2087. })
  2088. }).catch(() => {
  2089. this.$message({
  2090. type: 'info',
  2091. message: '已取消'
  2092. });
  2093. });
  2094. } else {
  2095. done()
  2096. }
  2097. })
  2098. },
  2099. // 复制新增
  2100. copyNew() {
  2101. this.$confirm('是否确认复制新增?', '提示', {
  2102. confirmButtonText: '确定',
  2103. cancelButtonText: '取消',
  2104. type: 'warning'
  2105. }).then(() => {
  2106. this.form.status = 0
  2107. this.form.id = ''
  2108. this.dataListBid = []
  2109. this.dataListBox.forEach(item => item.id = '')
  2110. this.dataListAgent.forEach(item => item.id = '')
  2111. this.$set(this.optionForm, 'disabled', false)
  2112. this.$set(this.optionBox, 'addRowBtn', true)
  2113. this.$set(this.optionAgent, 'addRowBtn', true)
  2114. this.optionBox.column.forEach(item => {
  2115. this.$set(item, 'disabled', false)
  2116. })
  2117. this.optionAgent.column.forEach(item => {
  2118. this.$set(item, 'disabled', false)
  2119. })
  2120. }).catch(() => {
  2121. this.$message({
  2122. type: 'info',
  2123. message: '已取消'
  2124. });
  2125. });
  2126. },
  2127. // 作废
  2128. toVoid() {
  2129. this.$confirm('是否确认作废?', '提示', {
  2130. confirmButtonText: '确定',
  2131. cancelButtonText: '取消',
  2132. type: 'warning'
  2133. }).then(() => {
  2134. confirmVoid({id: this.form.id}).then(res => {
  2135. this.$message({
  2136. type: 'success',
  2137. message: '作废成功!'
  2138. });
  2139. this.refreshData(this.form.id)
  2140. })
  2141. }).catch(() => {
  2142. this.$message({
  2143. type: 'info',
  2144. message: '已取消'
  2145. });
  2146. });
  2147. },
  2148. // 发布
  2149. release() {
  2150. this.$confirm('是否确认发布?', '提示', {
  2151. confirmButtonText: '确定',
  2152. cancelButtonText: '取消',
  2153. type: 'warning'
  2154. }).then(() => {
  2155. const loading = this.$loading({
  2156. lock: true,
  2157. text: '发布中',
  2158. spinner: 'el-icon-loading',
  2159. background: 'rgba(255,255,255,0.7)'
  2160. });
  2161. confirmRelease({id: this.form.id}).then(res => {
  2162. loading.close();
  2163. this.$message({
  2164. type: 'success',
  2165. message: '发布成功!'
  2166. });
  2167. this.refreshData(this.form.id)
  2168. }).catch(() => {
  2169. loading.close();
  2170. })
  2171. }).catch(() => {
  2172. this.$message({
  2173. type: 'info',
  2174. message: '已取消'
  2175. });
  2176. });
  2177. },
  2178. // 保存
  2179. storage() {
  2180. this.$refs['form'].validate((valid, done) => {
  2181. done()
  2182. if (valid) {
  2183. let form = {
  2184. ...this.form,
  2185. itemsList: this.dataListBox,
  2186. agentList: this.dataListAgent,
  2187. contrastList: this.dataListBid
  2188. }
  2189. this.fullscreenLoading = true
  2190. saveSaveList(form).then(res => {
  2191. this.refreshData(res.data.data.id)
  2192. this.$message.success('保存成功');
  2193. }).catch(error => {
  2194. this.$message.error('保存失败,请重试');
  2195. }).finally(() => {
  2196. this.fullscreenLoading = false
  2197. })
  2198. }
  2199. })
  2200. },
  2201. refreshData(id) {
  2202. let ids = ''
  2203. if (id) {
  2204. ids = id
  2205. } else {
  2206. ids = this.form.id
  2207. }
  2208. this.fullscreenLoading = true
  2209. detailDelegationList({id: ids}).then(res => {
  2210. this.form = res.data.data
  2211. this.dataListBox = this.form.itemsList
  2212. this.dataListAgent = this.form.agentList
  2213. this.dataListBid = this.form.contrastList
  2214. delete this.form.itemsList
  2215. delete this.form.agentList
  2216. delete this.form.contrastList
  2217. this.fullscreenLoading = false
  2218. })
  2219. },
  2220. }
  2221. }
  2222. </script>
  2223. <style scoped lang="scss">
  2224. ::v-deep .el-form-item {
  2225. margin-bottom: 8px;
  2226. }
  2227. </style>