detailsPage.vue 47 KB

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