detailsPage.vue 53 KB

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