detailsPage.vue 48 KB

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