detailsPage.vue 50 KB

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