detailsPage.vue 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  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="goBack(0)">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
  11. v-if="editButton" @click="inEdit">编 辑
  12. </el-button>
  13. <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
  14. :disabled="isSaveBtn || form.businessStatus != '录入'" @click="submit">保 存
  15. </el-button>
  16. <el-button v-if="form.id" class="el-button--small-yh" style="margin-left: 6px;" type="success" size="small"
  17. :disabled="form.businessStatus != '录入'" @click="application">单据请核
  18. </el-button>
  19. <el-button v-if="form.businessStatus == '提交审核'" class="el-button--small-yh" style="margin-left: 6px;"
  20. type="danger" size="small" @click="revokeApplication">撤销单据请核
  21. </el-button>
  22. <el-dropdown style="line-height: 0">
  23. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="warning" :disabled="!form.id"
  24. size="small">
  25. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  26. </el-button>
  27. <el-dropdown-menu slot="dropdown">
  28. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  29. </el-dropdown-item>
  30. </el-dropdown-menu>
  31. </el-dropdown>
  32. </div>
  33. </div>
  34. <div style="margin-top: 50px">
  35. <trade-card title="基础信息">
  36. <avue-form :option="optionForm" v-model="form" ref="form">
  37. <tempalte slot="corpName" slot-scope="{ row }">
  38. <dic-select v-model="form.corpName" placeholder="客户" key="id" label="cnName" res="records"
  39. url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
  40. @selectChange="dicChange('corpName', $event)" :disabled="editDisabled"></dic-select>
  41. </tempalte>
  42. <tempalte slot="countryOfOrigin" slot-scope="{ row }">
  43. <dic-select v-model="form.countryOfOrigin" placeholder="原产地" key="id" label="cnName" res="records"
  44. url="/blade-los/bcountrys/list" :filterable="true" :remote="true" dataName="cnName"
  45. :disabled="editDisabled"></dic-select>
  46. </tempalte>
  47. <tempalte slot="typeOfShipping" slot-scope="{ row }">
  48. <dic-select v-model="form.typeOfShipping" placeholder="运输方式" key="dictKey" label="dictValue"
  49. url="/blade-system/dict-biz/dictionary?code=mode_transport" :filterable="true"
  50. :disabled="editDisabled"></dic-select>
  51. </tempalte>
  52. <tempalte slot="polCnName" slot-scope="{ row }">
  53. <dic-select v-model="form.polCnName" placeholder="起运港" key="id" label="cnName" res="records"
  54. url="/blade-los/bports/list" :filterable="true" :remote="true" dataName="cnName"
  55. @selectChange="dicChange('polCnName', $event)" :disabled="editDisabled"></dic-select>
  56. </tempalte>
  57. <tempalte slot="podCnName" slot-scope="{ row }">
  58. <dic-select v-model="form.podCnName" placeholder="目的港" key="id" label="cnName" res="records"
  59. url="/blade-los/bports/list" :filterable="true" :remote="true" dataName="cnName"
  60. @selectChange="dicChange('podCnName', $event)" :disabled="editDisabled"></dic-select>
  61. </tempalte>
  62. <tempalte slot="currency" slot-scope="{ row }">
  63. <dic-select v-model="form.currency" placeholder="币别" key="id" label="code" res="records"
  64. url="/blade-los/bcurrency/page" :filterable="true" :disabled="editDisabled"></dic-select>
  65. </tempalte>
  66. <tempalte slot="abroadConsignorCname" slot-scope="{ row }">
  67. <dic-select v-model="form.abroadConsignorCname" placeholder="外国发货人" key="id" label="cnName"
  68. res="records" url="/blade-los/bcorps/listByType" :filterable="true" :remote="true"
  69. dataName="cnName" @selectChange="dicChange('abroadConsignorCname', $event)"
  70. :disabled="editDisabled"></dic-select>
  71. </tempalte>
  72. <tempalte slot="abroadBankMnemonicCode" slot-scope="{ row }">
  73. <dic-select ref="abankCode" v-model="form.abroadBankMnemonicCode" placeholder="银行助记码" key="id"
  74. label="accountNo" res="corpsBankList" url="/blade-los/bcorps/detail" :activateCreated="false"
  75. :filterable="true" @selectChange="dicChange('abroadBankMnemonicCode', $event)"
  76. :disabled="editDisabled"></dic-select>
  77. </tempalte>
  78. <tempalte slot="abroadCurrency" slot-scope="{ row }">
  79. <dic-select v-model="form.abroadCurrency" placeholder="币别" key="id" label="code" res="records"
  80. url="/blade-los/bcurrency/page" :filterable="true" :disabled="editDisabled"></dic-select>
  81. </tempalte>
  82. <tempalte slot="domesticConsigneeCname" slot-scope="{ row }">
  83. <dic-select v-model="form.domesticConsigneeCname" placeholder="国内收货人" key="id" label="cnName"
  84. res="records" url="/blade-los/bcorps/listByType" :filterable="true" :remote="true"
  85. dataName="cnName" @selectChange="dicChange('domesticConsigneeCname', $event)"
  86. :disabled="editDisabled"></dic-select>
  87. </tempalte>
  88. <tempalte slot="domesticBankMnemonicCode" slot-scope="{ row }">
  89. <dic-select ref="dbankCode" v-model="form.domesticBankMnemonicCode" placeholder="银行助记码" key="id"
  90. label="accountNo" res="corpsBankList" url="/blade-los/bcorps/detail" :activateCreated="false"
  91. :filterable="true" @selectChange="dicChange('domesticBankMnemonicCode', $event)"
  92. :disabled="editDisabled"></dic-select>
  93. </tempalte>
  94. <tempalte slot="domesticCurrency" slot-scope="{ row }">
  95. <dic-select v-model="form.domesticCurrency" placeholder="币别" key="id" label="code" res="records"
  96. url="/blade-los/bcurrency/page" :filterable="true" :disabled="editDisabled"></dic-select>
  97. </tempalte>
  98. <tempalte slot="documentType" slot-scope="{ row }">
  99. <dic-select v-model="form.documentType" placeholder="运输方式" key="dictKey" label="dictValue"
  100. url="/blade-system/dict-biz/dictionary?code=business_type" :filterable="true"
  101. :disabled="editDisabled"></dic-select>
  102. </tempalte>
  103. <tempalte slot="affiliatedCompanyName" slot-scope="{ row }">
  104. <dic-select v-model="form.affiliatedCompanyName" placeholder="所属公司" key="id" label="deptName"
  105. url="/blade-system/dept/lazy-list?parentId=0" :filterable="true"
  106. @selectChange="dicChange('affiliatedCompanyName', $event)"
  107. :disabled="editDisabled"></dic-select>
  108. </tempalte>
  109. <tempalte slot="srcCnName" slot-scope="{ row }">
  110. <dic-select v-model="form.srcCnName" placeholder="业务员" key="id" label="realName" res="records"
  111. url="/blade-user/page" :filterable="true" :remote="true" dataName="realName"
  112. @selectChange="dicChange('srcCnName', $event)" :disabled="editDisabled"></dic-select>
  113. </tempalte>
  114. </avue-form>
  115. </trade-card>
  116. <trade-card title="货物明细">
  117. <avue-crud :option="option" :data="form.agentItemsList" id="out-table" ref="crud"
  118. @selection-change="selectionChange" @resetColumn="resetColumn('crud', 'option', 'optionBack', 376)"
  119. @saveColumn="saveColumn('crud', 'option', 'optionBack', 376)">
  120. <template slot="menuLeft">
  121. <el-button type="primary" size="small" icon="el-icon-plus" :disabled="editDisabled"
  122. @click="addRow">新 增
  123. </el-button>
  124. <el-button type="success" size="small" :disabled="editDisabled" @click="allClick('首款账单')">首款账单
  125. </el-button>
  126. <el-button type="info" size="small" :disabled="editDisabled" @click="allClick('尾款账单')">尾款账单
  127. </el-button>
  128. <el-button type="warning" size="small" :disabled="selectionList.length == 0"
  129. @click="allClick('生成货代')">生成货代
  130. </el-button>
  131. <el-button size="small">打印账单
  132. </el-button>
  133. <el-dropdown>
  134. <el-button type="danger" size="small" :disabled="editDisabled">
  135. 申请付款<i class="el-icon-arrow-down el-icon--right"></i>
  136. </el-button>
  137. <el-dropdown-menu slot="dropdown">
  138. <el-dropdown-item @click.native="allClick('首款申请付款')">首款</el-dropdown-item>
  139. <el-dropdown-item @click.native="allClick('尾款申请付款')">尾款</el-dropdown-item>
  140. </el-dropdown-menu>
  141. </el-dropdown>
  142. <el-dropdown>
  143. <el-button type="danger" size="small" :disabled="editDisabled">
  144. 撤销申请付款<i class="el-icon-arrow-down el-icon--right"></i>
  145. </el-button>
  146. <el-dropdown-menu slot="dropdown">
  147. <el-dropdown-item @click.native="allClick('首款撤销申请付款')">首款</el-dropdown-item>
  148. <el-dropdown-item @click.native="allClick('尾款撤销申请付款')">尾款</el-dropdown-item>
  149. </el-dropdown-menu>
  150. </el-dropdown>
  151. <el-dropdown>
  152. <el-button type="primary" size="small">
  153. 应收待确认通知<i class="el-icon-arrow-down el-icon--right"></i>
  154. </el-button>
  155. <el-dropdown-menu slot="dropdown">
  156. <el-dropdown-item @click.native="allClick('首款应收待确认通知')">首款应收待确认通知</el-dropdown-item>
  157. <el-dropdown-item @click.native="allClick('尾款应收待确认通知')">尾款应收待确认通知</el-dropdown-item>
  158. </el-dropdown-menu>
  159. </el-dropdown>
  160. </template>
  161. <template slot="boxType" slot-scope="{ row }">
  162. <dic-select v-if="row.$cellEdit" v-model="row.boxType" placeholder="箱型" key="id" res="records"
  163. label="cnName" url="/blade-los/bcntrtypes/list" :filterable="true" :remote="true"
  164. dataName="cnName"></dic-select>
  165. <span v-else>{{ row.boxType }}</span>
  166. </template>
  167. <tempalte slot="orderReleaseMethod" slot-scope="{ row }">
  168. <dic-select v-if="row.$cellEdit" v-model="row.orderReleaseMethod" placeholder="放单方式" key="dictKey"
  169. label="dictValue" url="/blade-system/dict-biz/dictionary?code=release_method"
  170. :filterable="true"></dic-select>
  171. <span v-else>{{ row.orderReleaseMethod }}</span>
  172. </tempalte>
  173. <template slot="hsCode" slot-scope="{ row }">
  174. <dic-select v-if="row.$cellEdit" v-model="row.hsCode" placeholder="HSCODE" key="id" res="records"
  175. label="hsCode" url="/blade-los/bcommodity/list" :filterable="true" :remote="true"
  176. dataName="hsCode" @selectChange="rowDicChange('hsCode', $event, row)"></dic-select>
  177. <span v-else>{{ row.hsCode }}</span>
  178. </template>
  179. <tempalte slot="goodsType" slot-scope="{ row }">
  180. <dic-select v-if="row.$cellEdit" v-model="row.goodsType" placeholder="商品类型" key="dictKey"
  181. label="dictValue" url="/blade-system/dict-biz/dictionary?code=goods-type"
  182. :filterable="true"></dic-select>
  183. <span v-else>{{ row.goodsType }}</span>
  184. </tempalte>
  185. <tempalte slot="quantity" slot-scope="{ row }">
  186. <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)"
  187. :controls="false" placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
  188. <span v-else>{{ row.quantity }}</span>
  189. </tempalte>
  190. <tempalte slot="price" slot-scope="{ row }">
  191. <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)"
  192. :controls="false" placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
  193. <span v-else>{{ row.price }}</span>
  194. </tempalte>
  195. <template slot="menu" slot-scope="{ row, index }">
  196. <el-button size="small" icon="el-icon-edit" type="text" :disabled="editDisabled"
  197. @click="rowCell(row, index)">编 辑</el-button>
  198. <el-button size="small" icon="el-icon-delete" type="text" :disabled="editDisabled"
  199. @click="rowDel(row, index)">删
  200. 除</el-button>
  201. </template>
  202. </avue-crud>
  203. </trade-card>
  204. <trade-card title="费用明细">
  205. <fee-info :form="form" :disabled="editDisabled" @getDetails="getDetails"></fee-info>
  206. </trade-card>
  207. <trade-card title="记录信息">
  208. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  209. <el-tab-pane label="收款记录" name="1">
  210. <avue-crud :data="form.recordListD" :option="option1"></avue-crud>
  211. </el-tab-pane>
  212. <el-tab-pane label="付款记录" name="2">
  213. <avue-crud :data="form.recordListC" :option="option1"></avue-crud>
  214. </el-tab-pane>
  215. <el-tab-pane label="开票记录" name="3">
  216. <avue-crud :data="form.recordInvoiceList" :option="option2"></avue-crud>
  217. </el-tab-pane>
  218. <el-tab-pane label="付汇记录" name="4">
  219. <avue-crud :data="form.recordRateList" :option="option3"></avue-crud>
  220. </el-tab-pane>
  221. <el-tab-pane label="通关记录" name="5">
  222. <avue-crud :data="form.recordClearanceList" :option="option4"></avue-crud>
  223. </el-tab-pane>
  224. </el-tabs>
  225. </trade-card>
  226. <containerTitle title="上传附件"></containerTitle>
  227. <c-upload :data="form.filesCenterList" :enumerationValue="76"
  228. deleteUrl="/blade-purchase-sales/orderfiles/update" display :disabled="editDisabled"></c-upload>
  229. </div>
  230. <!--审核弹窗-->
  231. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  232. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  233. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  234. </el-dialog>
  235. </div>
  236. </template>
  237. <script>
  238. import { submit, getDetail, remove, checkAgent, revokeCheckAgent, copyAgent, generateDownPaymentBill, generateBalancePaymentBill, ApplyForPayment, revokeApplyForPayment, confirmationNotification, generateFreightForwarder } from "@/api/tradeAgency/tradeAgency";
  239. import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
  240. import feeInfo from "@/components/tradeAgency/fee-info";
  241. import dicSelect from "@/components/dicSelect/main";
  242. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  243. import { getBcorpsDetail } from "@/api/iosBasicData/bcorps";
  244. import { getToken } from "@/util/auth";
  245. import _ from "lodash";
  246. export default {
  247. name: "detailsPage",
  248. data() {
  249. return {
  250. selectionList: [],
  251. checkId: '', // 审核需要的id
  252. batchNo: '',
  253. checkScheduleDialog: false, // 审核弹窗
  254. editButton: false,
  255. editDisabled: false,
  256. activeName: '1',
  257. form: {
  258. billNoFormat: 'MYDL',
  259. businessTypeCode: 'MYDL',
  260. businessType: 'MYDL',
  261. businessStatus: '录入',
  262. agentItemsList: [],
  263. feeCenterListC: [],
  264. feeCenterListD: [],
  265. filesCenterList: [],
  266. recordClearanceList: [],
  267. recordInvoiceList: [],
  268. recordListC: [],
  269. recordListD: [],
  270. recordRateList: []
  271. },
  272. optionForm: {
  273. menuBtn: false,
  274. span: 8,
  275. disabled: false,
  276. column: [
  277. {
  278. label: '客户',
  279. prop: "corpName",
  280. disabled: false,
  281. rules: [{
  282. required: true,
  283. message: " ",
  284. trigger: "blur"
  285. }]
  286. },
  287. {
  288. label: '合同号',
  289. prop: "contractNo",
  290. disabled: false,
  291. rules: [{
  292. required: true,
  293. message: " ",
  294. trigger: "blur"
  295. }]
  296. },
  297. {
  298. label: '合同日期',
  299. prop: "contractDate",
  300. type: "date",
  301. format: "yyyy-MM-dd",
  302. valueFormat: "yyyy-MM-dd 00:00:00",
  303. disabled: false,
  304. rules: [{
  305. required: true,
  306. message: " ",
  307. trigger: "blur"
  308. }]
  309. },
  310. {
  311. label: '原产地',
  312. prop: "countryOfOrigin",
  313. disabled: false,
  314. rules: [{
  315. required: true,
  316. message: " ",
  317. trigger: "blur"
  318. }]
  319. },
  320. {
  321. label: '运输方式',
  322. prop: "typeOfShipping",
  323. disabled: false,
  324. rules: [{
  325. required: true,
  326. message: " ",
  327. trigger: "blur"
  328. }]
  329. },
  330. {
  331. label: '起运港',
  332. prop: "polCnName",
  333. disabled: false,
  334. },
  335. {
  336. label: '目的港',
  337. prop: "podCnName",
  338. disabled: false,
  339. },
  340. {
  341. label: '币别',
  342. prop: "currency",
  343. disabled: false,
  344. rules: [{
  345. required: true,
  346. message: " ",
  347. trigger: "blur"
  348. }]
  349. },
  350. {
  351. label: '外国发货人',
  352. prop: "abroadConsignorCname",
  353. disabled: false,
  354. },
  355. {
  356. label: '银行助记码',
  357. prop: "abroadBankMnemonicCode",
  358. disabled: false,
  359. },
  360. {
  361. label: '银行',
  362. prop: "abroadBank",
  363. disabled: false,
  364. },
  365. {
  366. label: '币别',
  367. prop: "abroadCurrency",
  368. disabled: false,
  369. },
  370. {
  371. label: '国内收货人',
  372. prop: "domesticConsigneeCname",
  373. disabled: false,
  374. },
  375. {
  376. label: '银行助记码',
  377. prop: "domesticBankMnemonicCode",
  378. disabled: false,
  379. },
  380. {
  381. label: '银行',
  382. prop: "domesticBank",
  383. disabled: false,
  384. },
  385. {
  386. label: '币别',
  387. prop: "domesticCurrency",
  388. disabled: false,
  389. },
  390. {
  391. label: '货值',
  392. prop: "goodsValue",
  393. disabled: true,
  394. },
  395. {
  396. label: '预付比例',
  397. prop: "advanceRatio",
  398. disabled: false,
  399. rules: [{
  400. required: true,
  401. message: " ",
  402. trigger: "blur"
  403. }]
  404. },
  405. {
  406. label: '预付金额',
  407. prop: "prepaidAmount",
  408. disabled: false,
  409. rules: [{
  410. required: true,
  411. message: " ",
  412. trigger: "blur"
  413. }]
  414. },
  415. {
  416. label: '单据类型',
  417. prop: "documentType",
  418. disabled: false,
  419. },
  420. {
  421. label: '所属公司',
  422. prop: "affiliatedCompanyName",
  423. disabled: false,
  424. },
  425. {
  426. label: '业务员',
  427. prop: "srcCnName",
  428. disabled: false,
  429. },
  430. {
  431. label: "审单状态",
  432. prop: "reviewStatus",
  433. type: "select",
  434. dicUrl: "/api/blade-system/dict-biz/dictionary?code=audit_status",
  435. props: {
  436. label: "dictValue",
  437. value: "dictValue"
  438. },
  439. },
  440. {
  441. label: '备注',
  442. prop: "remarks",
  443. type: 'textarea',
  444. disabled: false,
  445. span: 6,
  446. minRows: 2,
  447. },
  448. ]
  449. },
  450. option: {},
  451. optionBack: {
  452. height: 'auto',
  453. calcHeight: 30,
  454. menuWidth: 140,
  455. tip: false,
  456. border: true,
  457. index: true,
  458. addBtn: false,
  459. viewBtn: false,
  460. editBtn: false,
  461. delBtn: false,
  462. refreshBtn: false,
  463. selection: true,
  464. align: 'center',
  465. column: [
  466. {
  467. label: "提单号",
  468. prop: "billNo",
  469. width: "120",
  470. cell: true,
  471. overHidden: true
  472. },
  473. {
  474. label: "箱型",
  475. prop: "boxType",
  476. width: "120",
  477. overHidden: true,
  478. },
  479. {
  480. label: "箱号",
  481. prop: "boxNo",
  482. width: "120",
  483. cell: true,
  484. overHidden: true
  485. },
  486. {
  487. label: "铅封号",
  488. prop: "leadSealNo",
  489. width: "120",
  490. cell: true,
  491. overHidden: true
  492. },
  493. {
  494. label: "放单方式",
  495. prop: "orderReleaseMethod",
  496. width: "160",
  497. overHidden: true
  498. },
  499. {
  500. label: "PI发票号",
  501. prop: "invoiceNo",
  502. width: "160",
  503. cell: true,
  504. overHidden: true
  505. },
  506. {
  507. label: "订单号",
  508. prop: "orderNo",
  509. width: "120",
  510. cell: true,
  511. overHidden: true
  512. },
  513. {
  514. label: "开船日期",
  515. prop: "etd",
  516. width: "120",
  517. overHidden: true
  518. },
  519. {
  520. label: "预计到港",
  521. prop: "estimateReachHarbor",
  522. width: "120",
  523. overHidden: true
  524. },
  525. {
  526. label: "实际到港",
  527. prop: "actualReachHarbor",
  528. width: "120",
  529. overHidden: true
  530. },
  531. {
  532. label: "HSCODE",
  533. prop: "hsCode",
  534. width: "120",
  535. overHidden: true
  536. },
  537. {
  538. label: "厂号",
  539. prop: "factoryNumber",
  540. width: "120",
  541. cell: true,
  542. overHidden: true
  543. },
  544. {
  545. label: "标签品名",
  546. prop: "labelProductName",
  547. width: "120",
  548. overHidden: true
  549. },
  550. {
  551. label: "商品类别",
  552. prop: "goodsType",
  553. width: "120",
  554. overHidden: true
  555. },
  556. {
  557. label: "件数",
  558. prop: "quantity",
  559. width: "120",
  560. overHidden: true
  561. },
  562. {
  563. label: "净重(kg)",
  564. prop: "netWeight",
  565. width: "120",
  566. cell: true,
  567. type: 'number',
  568. controls: false,
  569. overHidden: true
  570. },
  571. {
  572. label: "单价",
  573. prop: "price",
  574. width: "120",
  575. overHidden: true
  576. },
  577. {
  578. label: "毛重(kg)",
  579. prop: "grossWeight",
  580. width: "120",
  581. cell: true,
  582. type: 'number',
  583. controls: false,
  584. overHidden: true
  585. },
  586. {
  587. label: "金额",
  588. prop: "amount",
  589. width: "120",
  590. overHidden: true
  591. },
  592. {
  593. label: "税率",
  594. prop: "taxRate",
  595. width: "120",
  596. overHidden: true
  597. },
  598. {
  599. label: "报关单号",
  600. prop: "customsDeclarationNo",
  601. width: "120",
  602. overHidden: true
  603. },
  604. {
  605. label: "报关日期",
  606. prop: "customsDeclarationDate",
  607. width: "120",
  608. overHidden: true
  609. },
  610. {
  611. label: "放行日期",
  612. prop: "releaseDate",
  613. width: "120",
  614. overHidden: true
  615. },
  616. {
  617. label: "派车日期",
  618. prop: "dispatchDate",
  619. width: "120",
  620. overHidden: true
  621. },
  622. {
  623. label: "库存件数",
  624. prop: "inventoryQuantity",
  625. width: "120",
  626. overHidden: true
  627. },
  628. {
  629. label: "货代",
  630. prop: "freightForwarder",
  631. width: "120",
  632. overHidden: true
  633. },
  634. {
  635. label: "备注",
  636. prop: "remarks",
  637. width: "120",
  638. cell: true,
  639. overHidden: true
  640. }
  641. ]
  642. },
  643. option1: {
  644. header: false,
  645. border: true,
  646. index: true,
  647. menu: false,
  648. align: 'center',
  649. column: [
  650. {
  651. label: '户头',
  652. prop: 'account'
  653. },
  654. {
  655. label: '账号',
  656. prop: 'accountNumber'
  657. },
  658. {
  659. label: '银行',
  660. prop: 'bank'
  661. },
  662. {
  663. label: '金额',
  664. prop: 'amount'
  665. },
  666. {
  667. label: '备注',
  668. prop: 'remarks'
  669. }
  670. ]
  671. },
  672. option2: {
  673. header: false,
  674. border: true,
  675. index: true,
  676. menu: false,
  677. align: 'center',
  678. column: [
  679. {
  680. label: '开票抬头',
  681. prop: 'invoiceHeader'
  682. },
  683. {
  684. label: '开票金额',
  685. prop: 'amount'
  686. },
  687. {
  688. label: '税率',
  689. prop: 'taxRate'
  690. },
  691. {
  692. label: '开票内容',
  693. prop: 'invoiceContent'
  694. },
  695. {
  696. label: '备注',
  697. prop: 'remarks'
  698. }
  699. ]
  700. },
  701. option3: {
  702. header: false,
  703. border: true,
  704. index: true,
  705. menu: false,
  706. align: 'center',
  707. column: [
  708. {
  709. label: '提单号',
  710. prop: 'billNo'
  711. },
  712. {
  713. label: '报关单号',
  714. prop: 'customsDeclarationNo'
  715. },
  716. {
  717. label: '日期',
  718. prop: 'date'
  719. },
  720. {
  721. label: '状态',
  722. prop: 'status'
  723. },
  724. {
  725. label: '备注',
  726. prop: 'remarks'
  727. }
  728. ]
  729. },
  730. option4: {
  731. header: false,
  732. border: true,
  733. index: true,
  734. menu: false,
  735. align: 'center',
  736. column: [
  737. {
  738. label: '日期',
  739. prop: 'date'
  740. },
  741. {
  742. label: '金额',
  743. prop: 'amount'
  744. },
  745. {
  746. label: '备注',
  747. prop: 'remarks'
  748. }
  749. ]
  750. }
  751. }
  752. },
  753. components: {
  754. dicSelect,
  755. feeInfo,
  756. checkSchedule
  757. },
  758. props: {
  759. detailData: Object
  760. },
  761. async created() {
  762. this.option = await this.getColumnData(this.getColumnName(376), this.optionBack);
  763. if (this.detailData.id) {
  764. this.editButton = true
  765. this.editDisabled = true
  766. this.optionForm.disabled = true
  767. this.getDetails(this.detailData.id)
  768. }
  769. },
  770. methods: {
  771. dicChange(name, row) {
  772. if (name == 'corpName') {
  773. if (row) {
  774. this.form.corpId = row.id
  775. } else {
  776. this.form.corpId = null
  777. }
  778. }
  779. if (name == 'polCnName') {
  780. console.log(row)
  781. if (row) {
  782. this.form.polId = row.id
  783. this.form.polCode = row.code
  784. this.form.polEnName = row.enName
  785. } else {
  786. this.form.polId = null
  787. this.form.polCode = null
  788. this.form.polEnName = null
  789. }
  790. }
  791. if (name == 'podCnName') {
  792. if (row) {
  793. this.form.polId = row.id
  794. this.form.polCode = row.code
  795. this.form.polEnName = row.enName
  796. } else {
  797. this.form.polId = null
  798. this.form.polCode = null
  799. this.form.polEnName = null
  800. }
  801. }
  802. if (name == 'abroadConsignorCname') {
  803. if (row) {
  804. this.$refs.abankCode.IdGetDicData({ id: row.id })
  805. this.form.abroadConsignorId = row.id
  806. this.form.abroadBankMnemonicCode = null
  807. this.form.abroadBank = null
  808. this.form.abroadCurrency = null
  809. } else {
  810. this.form.abroadConsignorId = null
  811. this.form.abroadBankMnemonicCode = null
  812. this.form.abroadBank = null
  813. this.form.abroadCurrency = null
  814. }
  815. }
  816. if (name == 'domesticConsigneeCname') {
  817. if (row) {
  818. this.$refs.dbankCode.IdGetDicData({ id: row.id })
  819. this.form.domesticConsigneeId = row.id
  820. this.form.domesticBankMnemonicCode = null
  821. this.form.domesticBank = null
  822. this.form.domesticCurrency = null
  823. } else {
  824. this.form.domesticConsigneeId = null
  825. this.form.domesticBankMnemonicCode = null
  826. this.form.domesticBank = null
  827. this.form.domesticCurrency = null
  828. }
  829. }
  830. if (name == 'affiliatedCompanyName') {
  831. if (row) {
  832. this.form.affiliatedCompanyTId = row.id
  833. } else {
  834. this.form.affiliatedCompanyId = null
  835. }
  836. }
  837. if (name == 'srcCnName') {
  838. if (row) {
  839. this.form.srcId = row.id
  840. } else {
  841. this.form.srcId = null
  842. }
  843. }
  844. if (name == 'abroadBankMnemonicCode') {
  845. if (row) {
  846. this.form.abroadBank = row.accountBank
  847. this.form.abroadCurrency = row.curNo
  848. } else {
  849. this.form.abroadBank = null
  850. this.form.abroadCurrency = null
  851. }
  852. }
  853. if (name == 'domesticBankMnemonicCode') {
  854. if (row) {
  855. this.form.domesticBank = row.accountBank
  856. this.form.domesticCurrency = row.curNo
  857. } else {
  858. this.form.domesticBank = null
  859. this.form.domesticCurrency = null
  860. }
  861. }
  862. },
  863. rowDicChange(name, row, el) {
  864. if (name == 'hsCode') {
  865. if (row) {
  866. el.labelProductName = row.cnName
  867. } else {
  868. el.labelProductName = null
  869. }
  870. }
  871. },
  872. countChange(row) {
  873. row.amount = _.multiply(Number(row.quantity ? row.quantity : 0), Number(row.price ? row.price : 0))
  874. },
  875. addRow() {
  876. if (!this.form.corpId) {
  877. return this.$message.error("请选择客户名称");
  878. }
  879. this.form.agentItemsList.push({ $cellEdit: true })
  880. // this.$refs.crud.rowAdd()
  881. },
  882. rowCell(row, index) {
  883. if (row.$cellEdit == true) {
  884. this.$set(row, "$cellEdit", false);
  885. } else {
  886. this.$set(row, "$cellEdit", true);
  887. }
  888. },
  889. rowDel(row, index) {
  890. this.$confirm("确定删除数据?", {
  891. confirmButtonText: "确定",
  892. cancelButtonText: "取消",
  893. type: "warning"
  894. }).then(() => {
  895. if (row.id) {
  896. remove({ ids: row.id }).then(res => {
  897. this.form.agentItemsList.splice(index, 1);
  898. this.$message.success("成功删除");
  899. })
  900. } else {
  901. this.form.agentItemsList.splice(index, 1);
  902. }
  903. });
  904. },
  905. selectionChange(list) {
  906. this.selectionList = list
  907. },
  908. getDetails(id) {
  909. const loading = this.$loading({
  910. lock: true,
  911. text: '加载中',
  912. spinner: 'el-icon-loading',
  913. background: 'rgba(255,255,255,0.7)'
  914. });
  915. getDetail({ id: id }).then(res => {
  916. this.form = res.data.data
  917. }).finally(() => {
  918. loading.close()
  919. })
  920. },
  921. inEdit() {
  922. this.editButton = false
  923. if (this.form.businessStatus == '录入') {
  924. this.editDisabled = false
  925. this.optionForm.disabled = false
  926. }
  927. },
  928. allClick(name) {
  929. if (name == '首款账单') {
  930. if (!this.form.domesticConsigneeCname) return this.$message.error("请选择国内收货人");
  931. bcurrencyGetExrate({ date: this.form.contractDate, dc: 'D' }).then(res => {
  932. res.data.data.forEach(e => {
  933. if (this.form.currency == e.code) {
  934. this.$prompt('请输入汇率', '首款账单', {
  935. confirmButtonText: '确定',
  936. cancelButtonText: '取消',
  937. inputValue: e.exrate
  938. }).then(({ value }) => {
  939. let obj = {}
  940. obj = {
  941. ...this.form,
  942. exchangeRate: value
  943. }
  944. generateDownPaymentBill(obj).then(res => {
  945. this.$message.success("成功生成首款账单");
  946. this.getDetails(this.form.id)
  947. })
  948. })
  949. }
  950. })
  951. })
  952. }
  953. if (name == '尾款账单') {
  954. if (!this.form.domesticConsigneeCname) return this.$message.error("请选择国内收货人");
  955. bcurrencyGetExrate({ date: this.form.contractDate, dc: 'D' }).then(res => {
  956. res.data.data.forEach(e => {
  957. if (this.form.currency == e.code) {
  958. this.$prompt('请输入汇率', '尾款账单', {
  959. confirmButtonText: '确定',
  960. cancelButtonText: '取消',
  961. inputValue: e.exrate
  962. }).then(({ value }) => {
  963. let obj = {}
  964. obj = {
  965. ...this.form,
  966. exchangeRate: value
  967. }
  968. generateBalancePaymentBill(obj).then(res => {
  969. this.$message.success("成功生成首款账单");
  970. this.getDetails(this.form.id)
  971. })
  972. })
  973. }
  974. })
  975. })
  976. }
  977. if (name == '首款申请付款') {
  978. if (this.form.applyForPayment == 1) return this.$message.error("请勿重复申请");
  979. let obj = {}
  980. obj = {
  981. id: this.form.id,
  982. url: '/tradeAgency/tradeAgency/index',
  983. pageStatus: '',
  984. pageLabel: '贸易代理(T)',
  985. paidApplication: 'FFSQ-SK'
  986. }
  987. ApplyForPayment(obj).then(res => {
  988. this.$message.success("申请付款成功");
  989. this.getDetails(this.form.id)
  990. })
  991. }
  992. if (name == '尾款申请付款') {
  993. if (this.form.applyForPaymentBalance == 1) return this.$message.error("请勿重复申请");
  994. let obj = {}
  995. obj = {
  996. id: this.form.id,
  997. url: '/tradeAgency/tradeAgency/index',
  998. pageStatus: '',
  999. pageLabel: '贸易代理(T)',
  1000. paidApplication: 'FFSQ-WK'
  1001. }
  1002. ApplyForPayment(obj).then(res => {
  1003. this.$message.success("申请付款成功");
  1004. this.getDetails(this.form.id)
  1005. })
  1006. }
  1007. if (name == '首款撤销申请付款') {
  1008. if (this.form.applyForPayment == 0) return this.$message.error("未申请付款");
  1009. let obj = {}
  1010. obj = {
  1011. id: this.form.id,
  1012. paidApplication: 'FFSQ-SK'
  1013. }
  1014. revokeApplyForPayment(obj).then(res => {
  1015. this.$message.success("撤销申请付款成功");
  1016. this.getDetails(this.form.id)
  1017. })
  1018. }
  1019. if (name == '尾款撤销申请付款') {
  1020. if (this.form.applyForPaymentBalance == 0) return this.$message.error("未申请付款");
  1021. let obj = {}
  1022. obj = {
  1023. id: this.form.id,
  1024. paidApplication: 'FFSQ-WK'
  1025. }
  1026. revokeApplyForPayment(obj).then(res => {
  1027. this.$message.success("撤销申请付款成功");
  1028. this.getDetails(this.form.id)
  1029. })
  1030. }
  1031. if (name == '首款应收待确认通知') {
  1032. this.$confirm("确定发起通知?", {
  1033. confirmButtonText: "确定",
  1034. cancelButtonText: "取消",
  1035. type: "warning"
  1036. }).then(() => {
  1037. let obj = {}
  1038. obj = {
  1039. id: this.form.id,
  1040. url: '/tradeAgency/tradeAgency/index',
  1041. pageStatus: '',
  1042. pageLabel: '贸易代理(T)',
  1043. paidApplication: 'YSQR-SK'
  1044. }
  1045. const loading = this.$loading({
  1046. lock: true,
  1047. text: '加载中',
  1048. spinner: 'el-icon-loading',
  1049. background: 'rgba(255,255,255,0.7)'
  1050. });
  1051. confirmationNotification(obj).then(res => {
  1052. this.$message.success("通知成功");
  1053. }).finally(() => {
  1054. loading.close();
  1055. })
  1056. });
  1057. }
  1058. if (name == '尾款应收待确认通知') {
  1059. this.$confirm("确定发起通知?", {
  1060. confirmButtonText: "确定",
  1061. cancelButtonText: "取消",
  1062. type: "warning"
  1063. }).then(() => {
  1064. let obj = {}
  1065. obj = {
  1066. id: this.form.id,
  1067. url: '/tradeAgency/tradeAgency/index',
  1068. pageStatus: '',
  1069. pageLabel: '贸易代理(T)',
  1070. paidApplication: 'YSQR-WK'
  1071. }
  1072. const loading = this.$loading({
  1073. lock: true,
  1074. text: '加载中',
  1075. spinner: 'el-icon-loading',
  1076. background: 'rgba(255,255,255,0.7)'
  1077. });
  1078. confirmationNotification(obj).then(res => {
  1079. this.$message.success("通知成功");
  1080. }).finally(() => {
  1081. loading.close();
  1082. })
  1083. });
  1084. }
  1085. if (name == '生成货代') {
  1086. let obj = {
  1087. ...this.form,
  1088. agentItemsList: this.selectionList
  1089. }
  1090. const loading = this.$loading({
  1091. lock: true,
  1092. text: '加载中',
  1093. spinner: 'el-icon-loading',
  1094. background: 'rgba(255,255,255,0.7)'
  1095. });
  1096. generateFreightForwarder(obj).then(res => {
  1097. this.$message.success("生成货代成功");
  1098. }).finally(() => {
  1099. loading.close();
  1100. })
  1101. }
  1102. },
  1103. submit() {
  1104. this.$refs["form"].validate((valid, done) => {
  1105. done();
  1106. if (valid) {
  1107. const loading = this.$loading({
  1108. lock: true,
  1109. text: '加载中',
  1110. spinner: 'el-icon-loading',
  1111. background: 'rgba(255,255,255,0.7)'
  1112. });
  1113. this.form.businessDate = this.form.contractDate
  1114. submit(this.form).then(res => {
  1115. this.$message.success("保存成功");
  1116. this.getDetails(res.data.data.id)
  1117. }).finally(() => {
  1118. loading.close();
  1119. })
  1120. } else {
  1121. return false;
  1122. }
  1123. });
  1124. },
  1125. application() {
  1126. if (this.form.downPayment != 1) return this.$message.error("未申请首款付款");
  1127. if (this.form.balancePayment != 1) return this.$message.error("未申请尾款付款");
  1128. if (this.form.applyForPayment != 1) return this.$message.error("未申请首款付款");
  1129. if (this.form.applyForPaymentBalance != 1) return this.$message.error("未申请尾款付款");
  1130. this.$confirm("确定请核数据?", {
  1131. confirmButtonText: "确定",
  1132. cancelButtonText: "取消",
  1133. type: "warning"
  1134. }).then(() => {
  1135. let obj = {}
  1136. obj = {
  1137. id: this.form.id,
  1138. url: '/tradeAgency/tradeAgency/index',
  1139. pageStatus: '',
  1140. pageLabel: '贸易代理(T)',
  1141. }
  1142. const loading = this.$loading({
  1143. lock: true,
  1144. text: '加载中',
  1145. spinner: 'el-icon-loading',
  1146. background: 'rgba(255,255,255,0.7)'
  1147. });
  1148. checkAgent(obj).then(res => {
  1149. this.$message.success("请核成功");
  1150. this.getDetails(res.data.data.id)
  1151. }).finally(() => {
  1152. loading.close();
  1153. })
  1154. });
  1155. },
  1156. revokeApplication() {
  1157. this.$confirm("确定撤销请核?", {
  1158. confirmButtonText: "确定",
  1159. cancelButtonText: "取消",
  1160. type: "warning"
  1161. }).then(() => {
  1162. let obj = {}
  1163. obj = {
  1164. id: this.form.id,
  1165. }
  1166. const loading = this.$loading({
  1167. lock: true,
  1168. text: '加载中',
  1169. spinner: 'el-icon-loading',
  1170. background: 'rgba(255,255,255,0.7)'
  1171. });
  1172. revokeCheckAgent(obj).then(res => {
  1173. this.$message.success("撤销请核成功");
  1174. this.getDetails(res.data.data.id)
  1175. this.editDisabled = false
  1176. this.optionForm.disabled = false
  1177. }).finally(() => {
  1178. loading.close();
  1179. })
  1180. });
  1181. },
  1182. //请核关闭
  1183. choceScheduleFun() {
  1184. this.checkScheduleDialog = false
  1185. },
  1186. //自定义列保存
  1187. async saveColumn(ref, option, optionBack, code) {
  1188. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1189. if (inSave) {
  1190. this.$message.success("保存成功");
  1191. //关闭窗口
  1192. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1193. }
  1194. },
  1195. //自定义列重置
  1196. async resetColumn(ref, option, optionBack, code) {
  1197. this[option] = this[optionBack];
  1198. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1199. if (inSave) {
  1200. this.$message.success("重置成功");
  1201. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1202. }
  1203. },
  1204. goBack(type) {
  1205. this.$emit("goBack", type);
  1206. this.$emit('updateKey')
  1207. },
  1208. }
  1209. }
  1210. </script>
  1211. <style lang="scss" scoped>
  1212. ::v-deep .el-form-item {
  1213. margin-bottom: 8px !important;
  1214. }
  1215. ::v-deep .el-table .cell {
  1216. padding: 0 2px !important;
  1217. .el-form-item {
  1218. margin-bottom: 0px !important;
  1219. }
  1220. }
  1221. ::v-deep .avue-crud .el-table .el-form-item__label {
  1222. left: -1px;
  1223. }
  1224. ::v-deep#out-table .back-one {
  1225. background: #ecf5ff !important;
  1226. }
  1227. ::v-deep#out-table .back-two {
  1228. background: #ecf5ff !important;
  1229. }
  1230. </style>