detailsPage.vue 46 KB

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