detailsPage.vue 47 KB

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