detailsPage.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList(0)">返回列表
  7. </el-button>
  8. <el-button v-if="detailData.id" type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  9. @click="backToList(1)">返回审核列表
  10. </el-button>
  11. </div>
  12. <div class="add-customer-btn">
  13. <el-button class="el-button--small-yh" style="margin-right: 10px" type="primary" size="small" :disabled="form.status>0"
  14. @click="confirmEdit" v-if="optionForm.disabled === true">编辑
  15. </el-button>
  16. <el-dropdown style="margin-right: 10px" v-if="false">
  17. <el-button type="primary" size="small">
  18. 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
  19. </el-button>
  20. <el-dropdown-menu slot="dropdown">
  21. <el-dropdown-item @click.native="pleaseCheck" :disabled="form.status>0">请核数据</el-dropdown-item>
  22. <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id">审核进度</el-dropdown-item>
  23. <el-dropdown-item @click.native="repealCancel" :disabled="form.status === 0 || !form.status" v-if="!detailData.id">撤销请核</el-dropdown-item>
  24. <!-- <el-dropdown-item @click.native="changeApproveOpen">特殊审批</el-dropdown-item>-->
  25. </el-dropdown-menu>
  26. </el-dropdown>
  27. <el-button class="el-button--small-yh" type="primary" size="small" :disabled="form.status>0"
  28. @click="editCustomer">
  29. 保存数据
  30. </el-button>
  31. </div>
  32. </div>
  33. <trade-card title="基础资料" style="margin-top: 50px">
  34. <avue-form :option="optionForm" v-model="form" ref="form">
  35. <template slot="purchaseCompanyId" slot-scope="scope">
  36. <crop-select v-model="form.purchaseCompanyId" @getCorpData="(row)=>{getGSData(row,['form','purchaseCompanyName'])}" :disabled="scope.disabled"
  37. corpType="KH"/>
  38. </template>
  39. <template slot="addressId" slot-scope="scope">
  40. <port-info :disabled="scope.disabled" v-model="form.addressId" type="id"
  41. @balabalaTow="(val)=>{balabala(val,['form','address'])}"/>
  42. </template>
  43. </avue-form>
  44. </trade-card>
  45. <trade-card title="箱信息">
  46. <avue-crud
  47. :option="option"
  48. :data="dataList"
  49. v-model="formTwo"
  50. ref="crud"
  51. :key="key"
  52. :before-open="beforeOpen"
  53. :upload-delete="uploadDelete"
  54. @row-save="rowSave"
  55. @row-update="rowUpdate"
  56. @selection-change="selectionChange"
  57. @resetColumn="resetColumnTwo('crud','option','optionBack',252.1)"
  58. @saveColumn="saveColumnTwo('crud','option','optionBack',252.1)">
  59. <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  60. <el-button icon="el-icon-edit" :size="size" :disabled="disabled" :type="type"
  61. @click="rowEditfun(row,index)">编辑
  62. </el-button>
  63. <el-button icon="el-icon-delete" :size="size" :disabled="disabled || row.count > 0" :type="type"
  64. @click="rowDel(row,index,'MX')">删除
  65. </el-button>
  66. </template>
  67. <template slot-scope="{ row }" slot="status">
  68. <span v-for="item in $refs.crud.DIC.status" :style="{color: item.colour}" v-if="item.dictKey == row.status">{{item.dictValue}}</span>
  69. </template>
  70. <template slot="addressForm" slot-scope="scope">
  71. <port-info v-model="formTwo.addressId" type="id" :disabled="scope.disabled" @balabalaTow="(val)=>{balabala(val,['formTwo','address'])}"/>
  72. </template>
  73. <!-- <template slot="boxMakingCompanyForm" slot-scope="scope">-->
  74. <!-- <crop-select v-model="formTwo.boxMakingCompanyId" :disabled="scope.disabled" :refresh="false"-->
  75. <!-- @getCorpData="(row)=>{getGSData(row,['formTwo','boxMakingCompany'])}" corpType="GS"/>-->
  76. <!-- </template>-->
  77. <template slot="menuLeft" slot-scope="scope">
  78. <!-- <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '录入'}) == -1?true:false)" type="primary" size="small"-->
  79. <!-- @click="statusUpdate('0','起租')">起租-->
  80. <!-- </el-button>-->
  81. <!-- <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '使用'}) == -1?true:false)" type="primary" size="small"-->
  82. <!-- @click="statusUpdate('1','退租')">退租-->
  83. <!-- </el-button>-->
  84. <!-- <el-button-->
  85. <!-- :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '退租'}) == -1?true:false)"-->
  86. <!-- type="primary" size="small"-->
  87. <!-- @click="statusUpdate('1','撤销退租')">撤销退租-->
  88. <!-- </el-button>-->
  89. <el-button :disabled="selectionList.length === 0 || option.disabled" type="primary" size="small"
  90. @click="statusUpdate('2','计算租金')">计算堆存费
  91. </el-button>
  92. <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.count > 0}) == -1?true:false)" type="primary" size="small"
  93. @click="statusUpdate('3','撤销租金')">撤销堆存费
  94. </el-button>
  95. <!-- <el-button :disabled="option.disabled" type="success" size="small" icon="el-icon-bottom" @click="importBox">导入</el-button>-->
  96. <!-- <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">报表打印</el-button>-->
  97. </template>
  98. </avue-crud>
  99. </trade-card>
  100. <!-- 报表-->
  101. <report-dialog
  102. :switchDialog="switchDialog"
  103. :reportId="form.id"
  104. reportName="堆箱"
  105. @onClose="onClose()"
  106. />
  107. <!-- 费用信息组件-->
  108. <box-cost v-model="dataListTwo" :id="form.id" type="DCF" activeName="second" :tabShow="3" :codeValue="252.2" ref="boxCost"
  109. @resetTrigger="resetTrigger"></box-cost>
  110. <trade-card title="附件明细">
  111. <c-upload
  112. basic
  113. :data="tradingBoxFilesList"
  114. :disabled="disabled"
  115. deleteUrl="/api/blade-box-tube/tradingBoxFiles/remove"
  116. :enumerationValue="252.3"
  117. display
  118. />
  119. </trade-card>
  120. <el-dialog
  121. :title="title"
  122. :visible.sync="dialogVisible"
  123. :append-to-body="true"
  124. :destroy-on-close="true"
  125. :close-on-click-modal="false"
  126. v-if="dialogVisible"
  127. width="60%">
  128. <span>
  129. <avue-form :option="optionState" v-model="formState" ref="formState">
  130. <template slot="addressId" slot-scope="scope">
  131. <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
  132. @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
  133. </template>
  134. </avue-form>
  135. </span>
  136. <span slot="footer" class="dialog-footer">
  137. <el-button @click="dialogVisible = false">取 消</el-button>
  138. <el-button type="primary" :disabled="disabledVisible" @click="confirmChange">确 定</el-button>
  139. </span>
  140. </el-dialog>
  141. <el-dialog title="导入箱档案" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  142. v-dialog-drag>
  143. <avue-form v-if="excelBox" :option="excelOption" v-model="excelForm" table-loading="excelLoading"
  144. :upload-before="uploadBefore" :upload-after="uploadAfter">
  145. <template slot="excelTemplate">
  146. <el-button type="primary" @click="derivation">
  147. 点击下载<i class="el-icon-download el-icon--right"></i>
  148. </el-button>
  149. </template>
  150. </avue-form>
  151. <p style="text-align: center;color: #DC0505">
  152. 温馨提示 第一次导入时请先下载模板
  153. </p>
  154. </el-dialog>
  155. <el-dialog
  156. append-to-body
  157. title="审批进度"
  158. class="el-dialogDeep"
  159. :visible.sync="checkScheduleDialog"
  160. width="40%"
  161. :close-on-click-modal="false"
  162. :destroy-on-close="true"
  163. :close-on-press-escape="false"
  164. v-dialog-drag
  165. >
  166. <check-schedule
  167. :checkId="checkId"
  168. :batchNo="batchNo"
  169. @choceScheduleFun="choceScheduleFun"
  170. ></check-schedule>
  171. </el-dialog>
  172. </div>
  173. </template>
  174. <script>
  175. import {
  176. detail,
  177. submit,
  178. tradingBoxFiles,
  179. selectArchivesList,
  180. tradingBoxItem,
  181. tradingBoxFees,
  182. pleaseCheck,
  183. repealCancel,
  184. statusUpdate, calculateRent, revokeRent, itemDetails, revokeRentingOut
  185. } from "@/api/boxManagement/stockpilingManage/index.js";
  186. import checkSchedule from "@/components/check/checkSchedule";
  187. import {selectByName} from "@/api/boxManagement";
  188. import {getToken} from "@/util/auth";
  189. import {dateFormat} from "@/util/date";
  190. import reportDialog from "@/components/report-dialog/main.vue";
  191. import {getParities} from "@/api/basicData/customerInquiry";
  192. export default {
  193. name: "detailsPage",
  194. props: {
  195. onLoad: Object,
  196. detailData: Object
  197. },
  198. components:{checkSchedule,reportDialog},
  199. data() {
  200. return {
  201. // 获取的汇率数据
  202. huiludate:{},
  203. switchDialog:false,
  204. excelOption: {
  205. submitBtn: false,
  206. emptyBtn: false,
  207. column: [
  208. {
  209. label: "模板下载",
  210. prop: "excelTemplate",
  211. formslot: true,
  212. span: 24
  213. },
  214. {
  215. label: "模板上传",
  216. prop: "excelFile",
  217. type: "upload",
  218. drag: true,
  219. loadText: "模板上传中,请稍等",
  220. span: 24,
  221. propsHttp: {
  222. res: "data"
  223. },
  224. tip: "请上传 .xls,.xlsx 标准格式文件",
  225. action: "/api/blade-box-tube/tradingBoxRent/import-tradingBox-info"
  226. }
  227. ]
  228. },
  229. excelForm:{},
  230. title: '',
  231. dialogVisible: false,
  232. excelBox: false,
  233. formSearch: {},
  234. optionState: {},
  235. formState: {},
  236. selectionList: [],
  237. optionStateTwo: {
  238. menuBtn: false,
  239. span: 12,
  240. column: [{
  241. label: '起租日期',
  242. prop: 'rentDate',
  243. width: 100,
  244. search: true,
  245. overHidden: true,
  246. type: "date",
  247. format: "yyyy-MM-dd",
  248. valueFormat: "yyyy-MM-dd HH:mm:ss",
  249. rules: [{
  250. required: true,
  251. message: " ",
  252. trigger: "blur"
  253. }]
  254. }]
  255. },
  256. optionStateFour: {
  257. menuBtn: false,
  258. span: 12,
  259. column: [{
  260. label: '起始日期',
  261. prop: 'rentStartDate',
  262. width: 100,
  263. type: "date",
  264. format: "yyyy-MM-dd",
  265. valueFormat: "yyyy-MM-dd HH:mm:ss",
  266. rules: [{
  267. required: true,
  268. message: " ",
  269. trigger: "blur"
  270. }]
  271. },{
  272. label: '结束日期',
  273. prop: 'rentCalculationDate',
  274. width: 100,
  275. type: "date",
  276. format: "yyyy-MM-dd",
  277. valueFormat: "yyyy-MM-dd HH:mm:ss",
  278. rules: [{
  279. required: true,
  280. message: " ",
  281. trigger: "blur"
  282. }]
  283. }]
  284. },
  285. optionStateThree: {
  286. menuBtn: false,
  287. span: 12,
  288. column: [{
  289. label: '地点',
  290. prop: 'addressId',
  291. rules: [{
  292. required: true,
  293. message: " ",
  294. trigger: "blur"
  295. }]
  296. }, {
  297. label: '退租日期',
  298. prop: 'rentDate',
  299. width: 100,
  300. search: true,
  301. overHidden: true,
  302. type: "date",
  303. format: "yyyy-MM-dd",
  304. valueFormat: "yyyy-MM-dd HH:mm:ss",
  305. rules: [{
  306. required: true,
  307. message: " ",
  308. trigger: "blur"
  309. }]
  310. }]
  311. },
  312. key: 0,
  313. checkScheduleDialog: false,
  314. checkId: '',
  315. batchNo: '',
  316. breakConfiguration: {
  317. multipleChoices: false,
  318. multiple: false,
  319. disabled: false,
  320. searchShow: true,
  321. collapseTags: false,
  322. clearable: true,
  323. placeholder: "请点击右边按钮选择",
  324. dicData: []
  325. },
  326. form: {},
  327. formTwo: {},
  328. optionForm: {
  329. menuBtn: false,
  330. span: 6,
  331. column: [{
  332. label: '系统号',
  333. prop: 'sysNo',
  334. disabled: true
  335. }, {
  336. label: '合同号',
  337. prop: 'contractNo',
  338. rules: [{
  339. required: true,
  340. message: " ",
  341. trigger: "blur"
  342. }]
  343. }, {
  344. label: '箱数',
  345. prop: 'boxNumber',
  346. width: 170,
  347. rules: [{
  348. required: true,
  349. message: " ",
  350. trigger: "blur"
  351. }]
  352. }, {
  353. label: '付费对象',
  354. prop: 'purchaseCompanyId',
  355. rules: [{
  356. required: true,
  357. message: " ",
  358. trigger: "blur"
  359. }]
  360. },{
  361. label: '堆存地点',
  362. prop: 'addressId',
  363. rules: [{
  364. required: true,
  365. message: " ",
  366. trigger: "blur"
  367. }]
  368. },{
  369. label: '备注',
  370. prop: 'remarks',
  371. type: 'textarea',
  372. minRows: 1,
  373. span: 18
  374. }]
  375. },
  376. option: {},
  377. optionBack: {
  378. align: 'center',
  379. index: true,
  380. addBtnText: "录入明细",
  381. refreshBtn: false,
  382. dialogDrag: true,
  383. addBtn: false,
  384. span: 8,
  385. selection: true,
  386. addRowBtn: false,
  387. cellBtn: false,
  388. editBtn: false,
  389. delBtn: false,
  390. menuWidth: 140,
  391. dialogTop: 25,
  392. // height:600,
  393. maxHeight:600,
  394. dialogWidth: "80%",
  395. showSummary: true,
  396. sumColumnList: [{
  397. name: 'emptyWeight',
  398. type: 'sum',
  399. decimals: 2
  400. },{
  401. name: 'grossWeight',
  402. type: 'sum',
  403. decimals: 2
  404. },{
  405. name: 'tare',
  406. type: 'sum',
  407. decimals: 2
  408. },{
  409. name: 'loadingWeight',
  410. type: 'sum',
  411. decimals: 2
  412. },{
  413. name: 'volume',
  414. type: 'sum',
  415. decimals: 2
  416. }],
  417. column: [{
  418. label: '箱号',
  419. prop: 'code',
  420. width: 100,
  421. overHidden: true,
  422. filterable: true,
  423. remote: true,
  424. allowCreate: true,
  425. disabled:true,
  426. type: "select",
  427. dicUrl: "/api/blade-box-tube/archives/selectArchivesList?size=10&current=1&code={{key}}",
  428. props: {
  429. label: "code",
  430. value: "code"
  431. },
  432. rules: [{
  433. required: true,
  434. message: " ",
  435. trigger: "blur"
  436. }]
  437. }, {
  438. label: '币别',
  439. prop: 'currency',
  440. width: 100,
  441. disabled:true,
  442. overHidden: true,
  443. filterable: true,
  444. type: "select",
  445. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  446. props: {
  447. label: "dictValue",
  448. value: "dictKey"
  449. },
  450. rules: [{
  451. required: true,
  452. message: " ",
  453. trigger: "blur"
  454. }]
  455. }, {
  456. label: '堆存费/天',
  457. prop: 'price',
  458. type: 'number',
  459. controls: false,
  460. overHidden: true,
  461. width: 100,
  462. rules: [{
  463. required: true,
  464. message: " ",
  465. trigger: "blur"
  466. }]
  467. }, {
  468. label: '堆存起',
  469. prop: 'leaseCommencementDate',
  470. overHidden: true,
  471. type: "date",
  472. disabled:true,
  473. format: "yyyy-MM-dd",
  474. valueFormat: "yyyy-MM-dd HH:mm:ss",
  475. width: 100,
  476. }, {
  477. label: '堆存止',
  478. prop: 'rentingOutDate',
  479. overHidden: true,
  480. type: "date",
  481. display: false,
  482. disabled:true,
  483. format: "yyyy-MM-dd",
  484. valueFormat: "yyyy-MM-dd HH:mm:ss",
  485. width: 100,
  486. }, {
  487. label: '当前堆存日期',
  488. prop: 'rentEndDate',
  489. overHidden: true,
  490. display: false,
  491. type: "date",
  492. disabled:true,
  493. format: "yyyy-MM-dd",
  494. valueFormat: "yyyy-MM-dd HH:mm:ss",
  495. width: 160
  496. }, {
  497. label: '箱类型',
  498. prop: 'boxTypeId',
  499. width: 100,
  500. overHidden: true,
  501. filterable: true,
  502. type: 'select',
  503. disabled:true,
  504. props: {
  505. label: 'name',
  506. value: 'id'
  507. },
  508. dicUrl: '/api/blade-client/container/listMessage'
  509. }, {
  510. label: '最新地点',
  511. prop: 'address',
  512. overHidden: true,
  513. disabled:true,
  514. formProp: 'addressId',
  515. width: 100,
  516. rules: [{
  517. required: false,
  518. message: " ",
  519. trigger: "blur"
  520. }]
  521. }, {
  522. label: '最新日期',
  523. prop: 'newDate',
  524. disabled:true,
  525. overHidden: true,
  526. width: 100,
  527. type: "date",
  528. format: "yyyy-MM-dd",
  529. valueFormat: "yyyy-MM-dd HH:mm:ss",
  530. rules: [{
  531. required: false,
  532. message: " ",
  533. trigger: "blur"
  534. }]
  535. }, {
  536. label: '箱来源',
  537. prop: 'boxSource',
  538. width: 100,
  539. overHidden: true,
  540. disabled:true,
  541. filterable: true,
  542. type: 'select',
  543. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
  544. props: {
  545. label: "dictValue",
  546. value: "dictKey"
  547. },
  548. rules: [{
  549. required: false,
  550. message: " ",
  551. trigger: "blur"
  552. }]
  553. }, {
  554. label: '箱状态',
  555. prop: 'boxStatus',
  556. width: 100,
  557. disabled:true,
  558. overHidden: true,
  559. filterable: true,
  560. type: 'select',
  561. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
  562. props: {
  563. label: "dictValue",
  564. value: "dictKey"
  565. },
  566. rules: [{
  567. required: false,
  568. message: " ",
  569. trigger: "blur"
  570. }]
  571. }, {
  572. label: '空重(kg)',
  573. prop: 'emptyWeight',
  574. type: 'number',
  575. overHidden: true,
  576. controls: false,
  577. disabled:true,
  578. width: 100,
  579. rules: [{
  580. required: false,
  581. message: " ",
  582. trigger: "blur"
  583. }]
  584. }, {
  585. label: '毛重(kg)',
  586. prop: 'grossWeight',
  587. type: 'number',
  588. disabled:true,
  589. overHidden: true,
  590. controls: false,
  591. width: 100,
  592. rules: [{
  593. required: false,
  594. message: " ",
  595. trigger: "blur"
  596. }]
  597. }, {
  598. label: '皮重(kg)',
  599. prop: 'tare',
  600. overHidden: true,
  601. disabled:true,
  602. type: 'number',
  603. controls: false,
  604. width: 100
  605. }, {
  606. label: '装载重量(kg)',
  607. prop: 'loadingWeight',
  608. type: 'number',
  609. overHidden: true,
  610. controls: false,
  611. disabled:true,
  612. width: 100
  613. }, {
  614. label: '容积(m³)',
  615. prop: 'volume',
  616. type: 'number',
  617. overHidden: true,
  618. disabled:true,
  619. controls: false,
  620. width: 100
  621. }, {
  622. label: '状态',
  623. prop: 'status',
  624. width: 100,
  625. overHidden: true,
  626. filterable: true,
  627. disabled: true,
  628. type: 'select',
  629. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_archives_status",
  630. props: {
  631. label: "dictValue",
  632. value: "dictKey"
  633. }
  634. }, {
  635. label: '造箱公司',
  636. prop: 'boxMakingCompany',
  637. overHidden: true,
  638. width: 100,
  639. disabled:true,
  640. rules: [{
  641. required: false,
  642. message: " ",
  643. trigger: "blur"
  644. }]
  645. }, {
  646. label: '造箱日期',
  647. prop: 'boxMakingDate',
  648. width: 100,
  649. overHidden: true,
  650. type: "date",
  651. disabled:true,
  652. format: "yyyy-MM-dd",
  653. valueFormat: "yyyy-MM-dd HH:mm:ss",
  654. rules: [{
  655. required: false,
  656. message: " ",
  657. trigger: "blur"
  658. }]
  659. }, {
  660. label: '箱来源日期',
  661. prop: 'leaseCommencementDate',
  662. width: 100,
  663. overHidden: true,
  664. type: "date",
  665. disabled:true,
  666. format: "yyyy-MM-dd",
  667. valueFormat: "yyyy-MM-dd HH:mm:ss"
  668. }, {
  669. label: '箱龄',
  670. prop: 'boxAge',
  671. type: 'number',
  672. disabled:true,
  673. controls: false,
  674. overHidden: true,
  675. width: 100,
  676. rules: [{
  677. required: false,
  678. message: " ",
  679. trigger: "blur"
  680. }]
  681. }, {
  682. label: '照片',
  683. prop: 'tradingBoxFilesList',
  684. width: 200,
  685. overHidden: true,
  686. type: 'upload',
  687. span: 24,
  688. listType: 'picture-card',
  689. tip: '只能上传jpg/png文件,且不超过500kb',
  690. propsHttp: {
  691. url: 'link',
  692. name: 'originalName',
  693. res: 'data'
  694. },
  695. action: '/api/blade-resource/oss/endpoint/put-file'
  696. }, {
  697. label: '备注',
  698. prop: 'remarks',
  699. overHidden: true,
  700. type: 'textarea',
  701. minRows: 3,
  702. span: 24,
  703. width: 200
  704. }]
  705. },
  706. dataList: [],
  707. dataListTwo:[],
  708. tradingBoxFilesList: [],
  709. disabled: false,
  710. disabledVisible: false,
  711. costData:{}
  712. }
  713. },
  714. async created() {
  715. this.option = await this.getColumnData(this.getColumnName(252.1), this.optionBack);
  716. selectByName("买箱费").then(res => {
  717. this.costData = res.data.data
  718. })
  719. //下拉箱号带出对应信息
  720. // this.findObject(this.option.column, "code").change = ({value, column}) => {
  721. // selectArchivesList({code: value}).then(res => {
  722. // for (let item of res.data.data) {
  723. // if (value == item.code) {
  724. // this.formTwo = {
  725. // boxSource: item.boxSource,
  726. // boxStatus: item.boxStatus,
  727. // emptyWeight: item.emptyWeight,
  728. // grossWeight: item.gorssWeight,
  729. // boxMakingCompany: item.boxMakingCompany,
  730. // boxMakingDate: item.boxMakingDate,
  731. // leaseCommencementDate: item.leaseCommencementDate,
  732. // boxAge: item.boxAge,
  733. // tare: item.tare,
  734. // loadingWeight: item.loadingWeight,
  735. // volume: item.volume,
  736. // }
  737. // }
  738. // }
  739. // })
  740. // }
  741. this.key++
  742. console.log(this.onLoad.id,this.detailData.id,740)
  743. if (this.onLoad.id && this.detailData.id) {
  744. this.refresh(this.onLoad.id,true)
  745. }else if (this.onLoad.id){
  746. this.refresh(this.onLoad.id,true)
  747. }
  748. },
  749. methods: {
  750. // 箱信息里的遍布按钮
  751. rowEditfun(row,index) {
  752. console.log(this.$refs.boxCost.dataList,751)
  753. this.$refs.boxCost.dataList.map(item=>{
  754. if (item.code == row.code && item.itemName == '堆存费' && item.submitPay == 0) {
  755. // 0 未生成 1已生成
  756. this.findObject(this.option.column, "currency").disabled = false
  757. }else {
  758. this.findObject(this.option.column, "currency").disabled = true
  759. }
  760. })
  761. this.$refs.crud.rowEdit(row,index)
  762. },
  763. // 报表
  764. openReport() {
  765. this.switchDialog = !this.switchDialog;
  766. },
  767. // 报表关闭
  768. onClose(val) {
  769. this.switchDialog = val;
  770. },
  771. importBox() {
  772. this.findObject(this.excelOption.column, "excelFile").data = {
  773. billtype: "DCF"
  774. }
  775. this.excelBox = true
  776. },
  777. derivation() {
  778. window.open(`/api/blade-box-tube/tradingBoxRent/export-tradingBox-info?${this.website.tokenHeader}=${getToken()}`);
  779. },
  780. uploadBefore(file, done, loading) {
  781. loading = true;
  782. done();
  783. },
  784. uploadAfter(res, done, loading, column) {
  785. this.excelBox = false;
  786. if (typeof res.message === "string") return
  787. for (let item of this.dataList){
  788. for (let li of res){
  789. if (item.code === li.code){
  790. return this.$message.error(`箱号:${item.code}重复!`);
  791. }
  792. }
  793. }
  794. this.dataList = this.dataList.concat(res)
  795. this.$message.success("导入成功!");
  796. loading = false;
  797. done();
  798. },
  799. statusUpdate(status, type) {
  800. if (this.form.id) {
  801. this.title = type == "计算租金"?"计算堆存费":type
  802. if (type === '起租') {
  803. this.optionState = this.optionStateTwo
  804. }else if (type === '退租') {
  805. this.optionState = this.optionStateThree
  806. this.formState.rentDate = dateFormat(new Date(), "yyyy-MM-dd") + " 23:59:59"
  807. } else if (type === '计算租金'){
  808. this.optionState = this.optionStateFour
  809. for (let item of this.selectionList) {
  810. for (let li of this.selectionList) {
  811. if (item.rentEndDate !== li.rentEndDate) {
  812. return this.$message.error(`${item.code} - ${item.rentEndDate},当前租金期间不相同,禁止选择`)
  813. }
  814. }
  815. }
  816. const date = new Date(this.selectionList[0].rentEndDate?this.selectionList[0].rentEndDate:new Date());
  817. const endDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
  818. this.formState.rentStartDate = this.selectionList[0].rentEndDate
  819. this.formState.rentCalculationDate = dateFormat(endDate, "yyyy-MM-dd") + " 23:59:59"
  820. if (this.selectionList[0].rentEndDate){
  821. let curDate = new Date(this.selectionList[0].rentEndDate);
  822. let endDateTime = new Date((curDate/1000+86400)*1000)
  823. this.formState.rentStartDate = dateFormat(endDateTime, "yyyy-MM-dd") + " 00:00:00"
  824. const endDateTwo = new Date(endDateTime.getFullYear(), endDateTime.getMonth() + 1, 0);
  825. this.formState.rentCalculationDate = dateFormat(endDateTwo, "yyyy-MM-dd") + " 23:59:59"
  826. }
  827. }else if(type === '撤销租金'){
  828. return this.$confirm('此操作将撤销堆存费并删除费用, 是否继续?', '提示', {
  829. confirmButtonText: '确定',
  830. cancelButtonText: '取消',
  831. type: 'warning'
  832. }).then(() => {
  833. const loading = this.$loading({
  834. lock: true,
  835. text: '加载中',
  836. spinner: 'el-icon-loading',
  837. background: 'rgba(255,255,255,0.7)'
  838. });
  839. revokeRent({
  840. ...this.form,
  841. tradingBoxItemsList:this.selectionList
  842. }).then(res => {
  843. this.$message.success("操作成功")
  844. this.formState = {}
  845. this.selectionList = []
  846. loading.close();
  847. this.refresh(this.form.id)
  848. }).catch(()=>{
  849. loading.close();
  850. })
  851. }).catch(() => {
  852. this.$message({
  853. type: 'info',
  854. message: '已取消删除'
  855. });
  856. });
  857. } else if (type === '撤销退租'){
  858. return this.$confirm('此操作将撤销退租并删除费用, 是否继续?', '提示', {
  859. confirmButtonText: '确定',
  860. cancelButtonText: '取消',
  861. type: 'warning'
  862. }).then(() => {
  863. revokeRentingOut({
  864. ...this.form,
  865. tradingBoxItemsList:this.selectionList
  866. }).then(res => {
  867. this.$message.success("操作成功")
  868. this.formState = {}
  869. this.refresh(this.form.id)
  870. })
  871. }).catch(() => {
  872. this.$message({
  873. type: 'info',
  874. message: '已取消删除'
  875. });
  876. });
  877. }else {
  878. this.optionState = this.optionStateThree
  879. }
  880. this.dialogVisible = true
  881. } else {
  882. this.$message.error('请保存后操作')
  883. }
  884. },
  885. confirmChange() {
  886. this.$refs["formState"].validate((valid, done) => {
  887. done()
  888. if (valid) {
  889. if (this.title === "起租" || this.title === "退租"){
  890. if (this.title === "退租") {
  891. if (Number(new Date(this.selectionList[0].rentEndDate)) > Number(new Date(this.formState.rentDate))) {
  892. return this.$message.error("退租日期不能小于当前租金期间")
  893. }
  894. }
  895. this.disabledVisible = true
  896. statusUpdate({
  897. ...this.form,
  898. ...this.formState,
  899. tradingBoxItemsList:this.selectionList,
  900. rentType:this.title === "起租"?1:2
  901. }).then(res => {
  902. this.$message.success("操作成功")
  903. this.dialogVisible = false
  904. this.disabledVisible = false
  905. this.formState = {}
  906. this.refresh(this.form.id)
  907. }).catch(() => {
  908. this.disabledVisible = false
  909. })
  910. }else {
  911. if (this.title === "计算堆存费"){
  912. if (Number(new Date(this.selectionList[0].leaseCommencementDate)) > Number(new Date(this.formState.rentStartDate))) {
  913. return this.$message.error("起始日期不能小于起租日期")
  914. }
  915. this.disabledVisible = true
  916. const loading = this.$loading({
  917. lock: true,
  918. text: '加载中',
  919. spinner: 'el-icon-loading',
  920. background: 'rgba(255,255,255,0.7)'
  921. });
  922. calculateRent({
  923. ...this.form,
  924. ...this.formState,
  925. tradingBoxItemsList:this.selectionList
  926. }).then(res => {
  927. this.$message.success("操作成功")
  928. this.dialogVisible = false
  929. this.disabledVisible = false
  930. this.formState = {}
  931. this.selectionList = []
  932. loading.close();
  933. this.refresh(this.form.id)
  934. }).catch(() => {
  935. this.disabledVisible = false
  936. loading.close();
  937. })
  938. }
  939. }
  940. }
  941. })
  942. },
  943. selectionChange(list) {
  944. this.selectionList = list
  945. },
  946. confirmEdit() {
  947. if (this.form.status > 0) {
  948. //基础资料
  949. this.$set(this.optionForm, "disabled", true)
  950. //箱信息
  951. this.$set(this.option, "disabled", true)
  952. this.$set(this.option, "addBtn", false)
  953. this.$set(this.option, "menu", false)
  954. //费用信息
  955. this.$set(this.$refs.boxCost.option,"disabled",true)
  956. this.$set(this.$refs.boxCost.option,"addBtn",false)
  957. this.$set(this.$refs.boxCost.option,"menu",false)
  958. //附件和顶部按钮
  959. this.disabled = true
  960. } else {
  961. //基础资料
  962. this.$set(this.optionForm, "disabled", false)
  963. //箱信息
  964. this.$set(this.option, "disabled", false)
  965. // this.$set(this.option, "addBtn", true)
  966. this.$set(this.option, "menu", true)
  967. //费用信息
  968. this.$set(this.$refs.boxCost.option,"disabled",false)
  969. this.$set(this.$refs.boxCost.option,"addBtn",true)
  970. this.$set(this.$refs.boxCost.option,"menu",true)
  971. //附件和顶部按钮
  972. this.disabled = false
  973. }
  974. this.key++
  975. },
  976. // 明细删除
  977. rowDel(row, index, type) {
  978. this.$confirm("确定将选择数据删除?", {
  979. confirmButtonText: "确定",
  980. cancelButtonText: "取消",
  981. type: "warning"
  982. }).then(() => {
  983. if (row.id) {
  984. tradingBoxItem(row.id).then(res => {
  985. if (res.data.success) {
  986. this.$message.success("操作成功!");
  987. this.dataList.splice(index, 1);
  988. if (this.dataListTwo.length > 0) {
  989. for (let item in this.dataListTwo) {
  990. if (this.dataListTwo[item].code == row.code) {
  991. if (this.dataListTwo[item].autoGenerate == 1) {
  992. if (this.dataListTwo[item].id) {
  993. tradingBoxFees(this.dataListTwo[item].id).then(res => {
  994. if (res.data.success) {
  995. this.dataListTwo.splice(index, 1);
  996. }
  997. });
  998. } else {
  999. this.dataListTwo.splice(Number(item), 1);
  1000. }
  1001. }
  1002. }
  1003. }
  1004. }
  1005. }
  1006. });
  1007. } else {
  1008. this.dataList.splice(index, 1);
  1009. this.$message.success("操作成功!");
  1010. if (this.dataListTwo.length > 0) {
  1011. for (let item in this.dataListTwo) {
  1012. if (this.dataListTwo[item].code == row.code) {
  1013. if (this.dataListTwo[item].autoGenerate == 1) {
  1014. this.dataListTwo.splice(Number(item), 1);
  1015. }
  1016. }
  1017. }
  1018. }
  1019. }
  1020. }
  1021. )
  1022. ;
  1023. },
  1024. balabala(row,type) {
  1025. this[type[0]][type[1]] = row.name
  1026. },
  1027. //撤销
  1028. repealCancel(){
  1029. this.$confirm("您确定撤回此次申请吗?", {
  1030. confirmButtonText: "确定",
  1031. cancelButtonText: "取消",
  1032. type: "warning"
  1033. }).then(() => {
  1034. const data = {
  1035. id : this.form.id,
  1036. pageLabel:"买箱",
  1037. checkFlag: 1,
  1038. }
  1039. const loading = this.$loading({
  1040. lock: true,
  1041. text: '加载中',
  1042. spinner: 'el-icon-loading',
  1043. background: 'rgba(255,255,255,0.7)'
  1044. });
  1045. repealCancel(data).then(res => {
  1046. loading.close();
  1047. this.$message.success('撤回成功')
  1048. this.refresh(this.form.id)
  1049. }).catch(()=>{
  1050. loading.close();
  1051. })
  1052. })
  1053. },
  1054. // 请核
  1055. pleaseCheck() {
  1056. this.$confirm("您确定提交请核申请吗?", {
  1057. confirmButtonText: "确定",
  1058. cancelButtonText: "取消",
  1059. type: "warning"
  1060. }).then(() => {
  1061. this.$refs["form"].validate((valid,done) => {
  1062. done()
  1063. if (valid) {
  1064. if (this.dataList.length === 0) {
  1065. return this.$message.error("箱信息不能为空")
  1066. }
  1067. if (this.$refs.boxCost.dataList.length === 0) {
  1068. return this.$message.error("费用信息不能为空")
  1069. }else {
  1070. for (let item of this.$refs.boxCost.dataList){
  1071. if (!item.id){
  1072. return this.$message.error("费用信息未保存")
  1073. }
  1074. }
  1075. }
  1076. let data = {
  1077. ...this.form,
  1078. tradingBoxItemsList: this.dataList,
  1079. tradingBoxFeesList: this.dataListTwo,
  1080. tradingBoxFilesList: this.tradingBoxFilesList,
  1081. type: "DCF"
  1082. }
  1083. const loading = this.$loading({
  1084. lock: true,
  1085. text: '加载中',
  1086. spinner: 'el-icon-loading',
  1087. background: 'rgba(255,255,255,0.7)'
  1088. });
  1089. submit(data).then(res => {
  1090. const data = {
  1091. id: res.data.data.id,
  1092. url: '/boxManagement/buyContainer/index',
  1093. pageStatus: "this.$store.getters.domSaleStatus",
  1094. pageLabel: "买箱",
  1095. checkFlag: 1,
  1096. }
  1097. pleaseCheck({
  1098. ...data,
  1099. type: "DCF"
  1100. }).then(rest => {
  1101. loading.close();
  1102. this.$message.success('请核成功')
  1103. this.refresh(res.data.data.id)
  1104. }).catch(()=>{
  1105. loading.close();
  1106. })
  1107. }).catch(()=>{
  1108. loading.close();
  1109. })
  1110. }
  1111. });
  1112. })
  1113. },
  1114. //审核关闭
  1115. choceScheduleFun(){
  1116. this.checkScheduleDialog = false
  1117. },
  1118. // 获取详情信息
  1119. refresh(id,type) {
  1120. const loading = this.$loading({
  1121. lock: true,
  1122. text: '加载中',
  1123. spinner: 'el-icon-loading',
  1124. background: 'rgba(255,255,255,0.7)'
  1125. });
  1126. detail({id: id}).then(res => {
  1127. this.form = res.data.data
  1128. // 箱信息数据
  1129. this.dataList = res.data.data.tradingBoxItemsList
  1130. // 费用信息数据
  1131. this.dataListTwo = res.data.data.tradingBoxFeesList
  1132. this.tradingBoxFilesList = res.data.data.tradingBoxFilesList
  1133. delete this.form.tradingBoxItemsList
  1134. delete this.form.tradingBoxFeesList
  1135. delete this.form.tradingBoxFilesList
  1136. this.$refs.boxCost.code = this.form.code
  1137. loading.close();
  1138. if (type) {
  1139. //基础资料
  1140. this.$set(this.optionForm, "disabled", true)
  1141. //箱信息
  1142. this.$set(this.option, "disabled", true)
  1143. this.$set(this.option, "addBtn", false)
  1144. this.$set(this.option, "menu", false)
  1145. //费用信息
  1146. this.$set(this.$refs.boxCost.option,"disabled",true)
  1147. this.$set(this.$refs.boxCost.option,"addBtn",false)
  1148. this.$set(this.$refs.boxCost.option,"menu",false)
  1149. //附件和顶部按钮
  1150. this.disabled = true
  1151. }else {
  1152. if (this.form.status > 0) {
  1153. //基础资料
  1154. this.$set(this.optionForm, "disabled", true)
  1155. //箱信息
  1156. this.$set(this.option, "disabled", true)
  1157. this.$set(this.option, "addBtn", false)
  1158. this.$set(this.option, "menu", false)
  1159. //费用信息
  1160. this.$set(this.$refs.boxCost.option,"disabled",true)
  1161. this.$set(this.$refs.boxCost.option,"addBtn",false)
  1162. this.$set(this.$refs.boxCost.option,"menu",false)
  1163. //附件和顶部按钮
  1164. this.disabled = true
  1165. } else {
  1166. //基础资料
  1167. this.$set(this.optionForm, "disabled", false)
  1168. //箱信息
  1169. this.$set(this.option, "disabled", false)
  1170. // this.$set(this.option, "addBtn", true)
  1171. this.$set(this.option, "menu", true)
  1172. //费用信息
  1173. this.$set(this.$refs.boxCost.option,"disabled",false)
  1174. this.$set(this.$refs.boxCost.option,"addBtn",true)
  1175. this.$set(this.$refs.boxCost.option,"menu",true)
  1176. //附件和顶部按钮
  1177. this.disabled = false
  1178. }
  1179. }
  1180. this.key++
  1181. })
  1182. },
  1183. //新增修改
  1184. editCustomer() {
  1185. this.$refs["form"].validate((valid,done) => {
  1186. done()
  1187. if (valid) {
  1188. let data = {
  1189. ...this.form,
  1190. tradingBoxItemsList: this.dataList,
  1191. tradingBoxFeesList: this.dataListTwo,
  1192. tradingBoxFilesList: this.tradingBoxFilesList,
  1193. type: "DCF"
  1194. }
  1195. const loading = this.$loading({
  1196. lock: true,
  1197. text: '加载中',
  1198. spinner: 'el-icon-loading',
  1199. background: 'rgba(255,255,255,0.7)'
  1200. });
  1201. submit(data).then(res => {
  1202. if (this.form.id) {
  1203. this.$message.success("修改成功")
  1204. } else {
  1205. this.$message.success("新增成功")
  1206. }
  1207. loading.close();
  1208. this.refresh(res.data.data.id)
  1209. }).catch(()=>{
  1210. loading.close();
  1211. })
  1212. }
  1213. });
  1214. },
  1215. rowSave(form,done,loading) {
  1216. let result = this.dataList.some((item) => {
  1217. if (item.code == form.code) {
  1218. return true
  1219. }
  1220. })
  1221. if (result === true) {
  1222. this.$message.error("已存在此箱号");
  1223. return loading();
  1224. }
  1225. done(form)
  1226. },
  1227. // 根据币别获取 汇率
  1228. // getParitiesfun(value){
  1229. // getParities({
  1230. // currency: value,
  1231. // businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
  1232. // }).then(res=>{
  1233. // this.huiludate = res.data.data
  1234. // })
  1235. // },
  1236. // 编辑弹窗点击确认的按钮事件
  1237. rowUpdate(form, index, done, loading) {
  1238. // 箱管理那边的修改币别 费用信息那边也要更改
  1239. this.$refs.boxCost.dataList.map(item=>{
  1240. if (item.code == form.code && item.itemName == '堆存费' && item.submitPay == 0) {
  1241. // 0 未生成 1已生成
  1242. item.currency = form.currency
  1243. // 汇率参数
  1244. // exchangeRate
  1245. }
  1246. })
  1247. if (!Number(form.price) || Number(form.price) < 0){
  1248. loading()
  1249. return this.$message.error('堆存费/天,不能不能为0或不能为负')
  1250. }
  1251. form.boxType = form.$boxTypeId
  1252. done(form)
  1253. },
  1254. //打开表单前
  1255. beforeOpen(done,type){
  1256. if (this.formTwo.count > 0){
  1257. this.findObject(this.option.column, "price").disabled = true
  1258. // this.findObject(this.option.column, "amount").disabled = true
  1259. }else {
  1260. this.findObject(this.option.column, "price").disabled = false
  1261. // this.findObject(this.option.column, "amount").disabled = false
  1262. }
  1263. if(['view','edit'].includes(type)){
  1264. itemDetails({id:this.formTwo.id,type: "DCF"}).then(res=>{
  1265. if (this.formTwo.tradingBoxFilesList.length === 0){
  1266. this.formTwo.tradingBoxFilesList = res.data.data.tradingBoxFilesList
  1267. }
  1268. })
  1269. // 查看和编辑逻辑
  1270. }
  1271. done();
  1272. },
  1273. //删除图片
  1274. uploadDelete(file, column) {
  1275. return new Promise((resolve, reject) => {
  1276. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  1277. confirmButtonText: '确定',
  1278. cancelButtonText: '取消',
  1279. type: 'warning'
  1280. }).then(() => {
  1281. if (this.formTwo.tradingBoxFilesList[file.uid].id) {
  1282. tradingBoxFiles(this.formTwo.tradingBoxFilesList[file.uid].id).then(res => {
  1283. this.$message({
  1284. type: 'success',
  1285. message: '删除成功!'
  1286. });
  1287. resolve();
  1288. })
  1289. } else {
  1290. resolve();
  1291. }
  1292. }).catch(()=>{
  1293. reject();
  1294. this.$message({
  1295. type: "info",
  1296. message: "已取消删除"
  1297. });
  1298. })
  1299. })
  1300. },
  1301. getGSData(row,type) {
  1302. this[type[0]][type[1]] = row.cname
  1303. },
  1304. backToList(type) {
  1305. if (type == 0){
  1306. if (this.detailData.id){
  1307. this.$router.push({
  1308. path: '/boxManagement/buyContainer/index'
  1309. });
  1310. }
  1311. this.$emit("backToList",type);
  1312. }else if (type == 1){
  1313. this.$router.push({
  1314. path: '/approveData/index'
  1315. });
  1316. this.$emit("backToList",type);
  1317. }
  1318. },
  1319. //自定义列保存
  1320. async saveColumnTwo(ref, option, optionBack, code) {
  1321. /**
  1322. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1323. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1324. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1325. */
  1326. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1327. if (inSave) {
  1328. this.$message.success("保存成功");
  1329. //关闭窗口
  1330. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1331. }
  1332. },
  1333. resetTrigger(){
  1334. if (this.optionForm.disabled == true) {
  1335. if (this.form.status > 0) {
  1336. //基础资料
  1337. this.$set(this.optionForm, "disabled", true)
  1338. //箱信息
  1339. this.$set(this.option, "disabled", true)
  1340. this.$set(this.option, "addBtn", false)
  1341. this.$set(this.option, "menu", false)
  1342. //费用信息
  1343. this.$set(this.$refs.boxCost.option,"disabled",true)
  1344. this.$set(this.$refs.boxCost.option,"addBtn",false)
  1345. this.$set(this.$refs.boxCost.option,"menu",false)
  1346. //附件和顶部按钮
  1347. this.disabled = true
  1348. } else {
  1349. //基础资料
  1350. this.$set(this.optionForm, "disabled", false)
  1351. //箱信息
  1352. this.$set(this.option, "disabled", false)
  1353. // this.$set(this.option, "addBtn", true)
  1354. this.$set(this.option, "menu", true)
  1355. //费用信息
  1356. this.$set(this.$refs.boxCost.option,"disabled",false)
  1357. this.$set(this.$refs.boxCost.option,"addBtn",true)
  1358. this.$set(this.$refs.boxCost.option,"menu",true)
  1359. //附件和顶部按钮
  1360. this.disabled = false
  1361. }
  1362. }else {
  1363. //基础资料
  1364. this.$set(this.optionForm, "disabled", false)
  1365. //箱信息
  1366. this.$set(this.option, "disabled", false)
  1367. // this.$set(this.option, "addBtn", true)
  1368. this.$set(this.option, "menu", true)
  1369. //费用信息
  1370. this.$set(this.$refs.boxCost.option,"disabled",true)
  1371. this.$set(this.$refs.boxCost.option,"addBtn",false)
  1372. this.$set(this.$refs.boxCost.option,"menu",false)
  1373. //附件和顶部按钮
  1374. this.disabled = false
  1375. }
  1376. this.key++
  1377. },
  1378. //自定义列重置
  1379. async resetColumnTwo(ref, option, optionBack, code) {
  1380. this[option] = this[optionBack];
  1381. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1382. if (inSave) {
  1383. this.resetTrigger()
  1384. this.$message.success("重置成功");
  1385. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1386. }
  1387. }
  1388. }
  1389. }
  1390. </script>
  1391. <style scoped>
  1392. ::v-deep .el-form-item {
  1393. margin-bottom: 8px;
  1394. }
  1395. </style>