detailsPage.vue 46 KB

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