detailPage.vue 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back" v-if="!home">
  5. <el-button
  6. type="danger"
  7. style="border: none;background: none;color: red"
  8. icon="el-icon-arrow-left"
  9. @click="backToList(0)"
  10. >返回列表
  11. </el-button>
  12. </div>
  13. <div class="customer-back" v-else>
  14. <el-button
  15. type="danger"
  16. style="border: none;background: none;color: red"
  17. icon="el-icon-arrow-left"
  18. @click="backToList(1)"
  19. >返回列表
  20. </el-button>
  21. <el-button
  22. type="danger"
  23. v-if="returnButton"
  24. style="border: none;background: none;color: red"
  25. icon="el-icon-arrow-left"
  26. @click="backToList(2)"
  27. >返回首页
  28. </el-button>
  29. <el-button
  30. type="danger"
  31. v-if="!returnButton"
  32. style="border: none;background: none;color: red"
  33. icon="el-icon-arrow-left"
  34. @click="backToList(3)"
  35. >返回台账
  36. </el-button>
  37. </div>
  38. <div>
  39. <div class="el-button&#45;&#45;small-yh add-customer-btn">
  40. <el-button
  41. type="warning"
  42. size="small"
  43. v-if="goodsForm.status > 0"
  44. :disabled="
  45. (this.roleName.indexOf('平台') !== -1
  46. ||this.roleName.indexOf('经理') !== -1
  47. ||this.roleName.indexOf('部门经理') !== -1
  48. ||this.roleName.indexOf('总经理') !== -1) && !(this.roleName.indexOf('admin') !== -1)"
  49. @click="confirmChange"
  50. >变更
  51. </el-button>
  52. <el-button
  53. type="success"
  54. v-if="goodsForm.status === 0 && typeTwo === false"
  55. size="small"
  56. :loading="type"
  57. @click="submit(true)"
  58. >提交
  59. </el-button>
  60. <el-button
  61. type="success"
  62. v-if="goodsForm.status === 1"
  63. size="small"
  64. @click="submit(false)"
  65. >取消提交
  66. </el-button>
  67. <el-button
  68. type="primary"
  69. :disabled="goodsForm.status >= 1"
  70. size="small"
  71. :loading="type"
  72. v-if="!typeTwo"
  73. @click="editCustomer"
  74. >保存
  75. </el-button>
  76. <el-button
  77. type="primary"
  78. :disabled="goodsForm.status === 1"
  79. size="small"
  80. v-else
  81. :loading="type"
  82. @click="changeSaving"
  83. >变更保存
  84. </el-button>
  85. </div>
  86. </div>
  87. </div>
  88. <trade-card title="业务类型" style="margin-top: 50px">
  89. <avue-form v-model="goodsForm" :option="goodsOptionFormC" ref="goodsFormE"></avue-form>
  90. </trade-card>
  91. <trade-card title="委托信息">
  92. <avue-form :option="goodsOptionForm" ref="goodsForm" v-model="goodsForm">
  93. <template slot-scope="{}" slot="corpIdLabel">
  94. <e-crop-jump label="公司名称" corp-type="KH" :value="goodsForm.corpName"></e-crop-jump>
  95. </template>
  96. <template slot-scope="scope" slot="corpId">
  97. <!-- <crop-select-->
  98. <!-- :disabled="goodsForm.status !== 0"-->
  99. <!-- v-model="goodsForm.corpId"-->
  100. <!-- @getCorpData="getCorpData"-->
  101. <!-- :corpType="'KH'"-->
  102. <!-- ></crop-select>-->
  103. <e-crop-select
  104. v-model="goodsForm.corpId"
  105. :name.sync="goodsForm.corpName"
  106. corp-type="KH"
  107. :disabled="goodsForm.status !== 0"
  108. @getCropId="getCropId"
  109. />
  110. </template>
  111. <template slot-scope="{}" slot="stationLabel">
  112. <e-crop-jump label="场站" corp-type="DD" :value="goodsForm.station"></e-crop-jump>
  113. </template>
  114. <template slot-scope="scope" slot="station">
  115. <!-- <port-info-->
  116. <!-- v-model="goodsForm.station"-->
  117. <!-- :disabled="goodsForm.status !== 0"-->
  118. <!-- />-->
  119. <e-crop-select
  120. v-model="goodsForm.station"
  121. corp-type="DD"
  122. :name.sync="goodsForm.station"
  123. :disabled="goodsForm.status !== 0"
  124. />
  125. </template>
  126. <template slot-scope="scope" slot="salesman">
  127. <el-select v-model="goodsForm.salesman" placeholder="请选择" :disabled="goodsForm.status !== 0"
  128. @change="changeSelect">
  129. <el-option
  130. v-for="item in salesmanList"
  131. :key="item.id"
  132. :label="item.realName"
  133. :value="item.id">
  134. </el-option>
  135. </el-select>
  136. </template>
  137. <template slot-scope="scope" slot="agentId">
  138. <crop-select
  139. :disabled="goodsForm.status !== 0"
  140. v-model="goodsForm.agentId"
  141. ></crop-select>
  142. </template>
  143. <template slot-scope="scope" slot="polId">
  144. <port-info
  145. v-model="goodsForm.polId"
  146. :disabled="goodsForm.status !== 0"
  147. />
  148. </template>
  149. <template slot-scope="scope" slot="podId">
  150. <port-info
  151. v-model="goodsForm.podId"
  152. :disabled="goodsForm.status !== 0"
  153. />
  154. </template>
  155. </avue-form>
  156. </trade-card>
  157. <trade-card title="其他信息" ref="other">
  158. <avue-form :option="goodsOptionFormTwo" v-model="goodsForm">
  159. <template slot-scope="scope" slot="corpId">
  160. <crop-select
  161. :disabled="goodsForm.status !== 0"
  162. v-model="goodsForm.corpId"
  163. @getCorpData="getCorpData"
  164. :corpType="'KH'"
  165. ></crop-select>
  166. </template>
  167. <template slot-scope="scope" slot="station">
  168. <port-info
  169. v-model="goodsForm.station"
  170. :disabled="goodsForm.status !== 0"
  171. />
  172. </template>
  173. <template slot-scope="scope" slot="salesman">
  174. <el-select v-model="goodsForm.salesman" placeholder="请选择" :disabled="goodsForm.status !== 0">
  175. <el-option
  176. v-for="item in salesmanList"
  177. :key="item.id"
  178. :label="item.realName"
  179. :value="item.id">
  180. </el-option>
  181. </el-select>
  182. </template>
  183. <template slot-scope="scope" slot="agentId">
  184. <crop-select
  185. :disabled="goodsForm.status !== 0"
  186. v-model="goodsForm.agentId"
  187. ></crop-select>
  188. </template>
  189. <template slot-scope="{}" slot="agentIdLabel">
  190. <e-crop-jump label="订舱代理" corp-type="KH" :value="goodsForm.agentName"></e-crop-jump>
  191. </template>
  192. <template slot-scope="scope" slot="agentId">
  193. <!-- <crop-select-->
  194. <!-- :disabled="goodsForm.status !== 0"-->
  195. <!-- v-model="goodsForm.corpId"-->
  196. <!-- @getCorpData="getCorpData"-->
  197. <!-- :corpType="'KH'"-->
  198. <!-- ></crop-select>-->
  199. <e-crop-select
  200. v-model="goodsForm.agentId"
  201. corp-type="KH"
  202. :name.sync="goodsForm.agentName"
  203. :disabled="goodsForm.status !== 0"
  204. @getCropId="getCropId"
  205. />
  206. </template>
  207. <!-- <template slot-scope="scope" slot="polId">-->
  208. <!-- <port-info-->
  209. <!-- :type="'id'"-->
  210. <!-- v-model="goodsForm.polId"-->
  211. <!-- :disabled="goodsForm.status !== 0"-->
  212. <!-- />-->
  213. <!-- </template>-->
  214. <template slot-scope="{}" slot="polIdLabel">
  215. <e-crop-jump label="起运港" corp-type="DD" :value="goodsForm.polName"></e-crop-jump>
  216. </template>
  217. <template slot-scope="scope" slot="polId">
  218. <e-crop-select
  219. v-model="goodsForm.polId"
  220. corp-type="DD-ID"
  221. :name.sync="goodsForm.polName"
  222. :disabled="goodsForm.status !== 0"
  223. />
  224. </template>
  225. <template slot-scope="{}" slot="podIdLabel">
  226. <e-crop-jump label="目的港" corp-type="DD" :value="goodsForm.podName"></e-crop-jump>
  227. </template>
  228. <template slot-scope="scope" slot="podId">
  229. <e-crop-select
  230. v-model="goodsForm.podId"
  231. corp-type="DD-ID"
  232. :name.sync="goodsForm.podName"
  233. :disabled="goodsForm.status !== 0"
  234. />
  235. </template>
  236. <!-- <template slot-scope="scope" slot="podId">-->
  237. <!-- <port-info-->
  238. <!-- :type="'id'"-->
  239. <!-- v-model="goodsForm.podId"-->
  240. <!-- :disabled="goodsForm.status !== 0"-->
  241. <!-- />-->
  242. <!-- </template>-->
  243. </avue-form>
  244. </trade-card>
  245. <trade-card title="箱信息" v-if="goodsForm.status === 0 || !goodsForm.status">
  246. <avue-crud :data="entrustList"
  247. :option="entrustOptionTwo"
  248. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  249. @row-update="rowSave"
  250. ref="crudBox"
  251. v-if="KeyBox>0"
  252. @resetColumn="resetColumnBox"
  253. @saveColumn="saveColumnBox"
  254. @row-del="rowDel">
  255. <template slot="headerSerial" slot-scope="{column}">
  256. <el-tooltip class="item" effect="dark" content="录入明细" placement="top">
  257. <el-button type="primary" icon="el-icon-circle-plus-outline" circle size="mini"
  258. @click="$refs.crudBox.rowCellAdd({arrivalTime:new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 14)+'00:00',landAmountD:0,landWeight:0})"></el-button>
  259. </el-tooltip>
  260. </template>
  261. <template slot="ctnTypeHeader" slot-scope="{column}">
  262. {{ column.label }}<span style="color:#F56C6C">*</span>
  263. </template>
  264. <template slot="ctnQuantityHeader" slot-scope="{column}">
  265. {{ column.label }}<span style="color:#F56C6C">*</span>
  266. </template>
  267. <!-- <template slot="landWeightHeader" slot-scope="{column}">-->
  268. <!-- {{ column.label }}<span style="color:#F56C6C">*</span>-->
  269. <!-- </template>-->
  270. <!-- <template slot="landAmountDHeader" slot-scope="{column}">-->
  271. <!-- {{ column.label }}<span style="color:#F56C6C">*</span>-->
  272. <!-- </template>-->
  273. <template slot="arrivalTimeHeader" slot-scope="{column}">
  274. {{ column.label }}<span style="color:#F56C6C">*</span>
  275. </template>
  276. </avue-crud>
  277. </trade-card>
  278. <trade-card title="箱信息" v-if="goodsForm.status !== 0 && goodsForm.status">
  279. <avue-crud
  280. :data="entrustList"
  281. :option="entrustOptionTwoT"
  282. ref="crudBoxTwo"
  283. v-if="KeyBoxTwo>0"
  284. @resetColumn="resetColumnBoxTwo"
  285. @saveColumn="saveColumnBoxTwo"
  286. @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
  287. @row-update="rowSaveT">
  288. <template slot="fleetId" slot-scope="{ row, index }">
  289. <crop-select
  290. v-if="row.$cellEdit"
  291. v-model="row.fleetId"
  292. :cropIndex="index"
  293. @getCorpData="(data)=>{getfleetIdT(data,row)}"
  294. ></crop-select>
  295. <span v-else>{{ row.fleetName }}</span>
  296. </template>
  297. </avue-crud>
  298. </trade-card>
  299. <trade-card title="起止地信息">
  300. <el-table
  301. ref="singleTable"
  302. :data="tableData"
  303. size="mini"
  304. :header-cell-style="{color:'#000',background:'#fafafa'}"
  305. style="width: 100%">
  306. <el-table-column
  307. align="center"
  308. v-if="goodsForm.status === 0"
  309. width="40">
  310. <template slot-scope="scope">
  311. <el-tooltip className="item" v-if="scope.$index === tableData.length-1" effect="dark" content="增加途径地址"
  312. placement="top">
  313. <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"
  314. style="margin-right: 1.25rem;"></el-button>
  315. </el-tooltip>
  316. </template>
  317. </el-table-column>
  318. <el-table-column
  319. property="date"
  320. align="center"
  321. width="40">
  322. <template slot-scope="scope">
  323. <span v-if="scope.$index == 0">
  324. <el-button type="primary" size="mini" circle>起</el-button>
  325. </span>
  326. <span v-else-if="scope.$index === tableData.length-1">
  327. <el-button type="success" size="mini" circle>止</el-button>
  328. </span>
  329. <span v-else>
  330. <el-button v-if="goodsForm.status !== 0" type="warning" size="mini" circle>途</el-button>
  331. <el-tooltip v-else class="item" effect="dark" content="删除" placement="left">
  332. <el-button type="danger" icon="el-icon-delete" size="mini" circle
  333. @click="deleteAddress(scope)"></el-button>
  334. </el-tooltip>
  335. </span>
  336. </template>
  337. </el-table-column>
  338. <el-table-column
  339. type="index"
  340. label="序号"
  341. align="center"
  342. width="60">
  343. </el-table-column>
  344. <el-table-column
  345. property="corpId"
  346. label="货运地点"
  347. align="center"
  348. :render-header="customTitle"
  349. width="280">
  350. <template slot-scope="scope">
  351. <crop-select
  352. :corpType="'GC'"
  353. :disabled="goodsForm.status !== 0"
  354. v-model="scope.row.corpId"
  355. @clear="clear(scope.row)"
  356. @getCorpData="(row)=>{withAddress(row,scope)}"/>
  357. </template>
  358. </el-table-column>
  359. <!-- <el-table-column-->
  360. <!-- property="province"-->
  361. <!-- label="省市区"-->
  362. <!-- align="center"-->
  363. <!-- width="280">-->
  364. <!-- <template slot-scope="scope">-->
  365. <!-- <el-cascader-->
  366. <!-- size="small"-->
  367. <!-- style="width: 100%;"-->
  368. <!-- :key="scope.row.key"-->
  369. <!-- :disabled="goodsForm.status === 1"-->
  370. <!-- :props="treeOption"-->
  371. <!-- clearable-->
  372. <!-- v-model="scope.row.region"></el-cascader>-->
  373. <!-- </template>-->
  374. <!-- </el-table-column>-->
  375. <el-table-column
  376. property="address"
  377. align="center"
  378. width="150"
  379. label="联系人">
  380. <template slot-scope="scope">
  381. <el-input v-model="scope.row.contacts" :disabled="goodsForm.status !== 0" size="small"
  382. placeholder="请输入内容"></el-input>
  383. </template>
  384. </el-table-column>
  385. <el-table-column
  386. property="address"
  387. align="center"
  388. width="180"
  389. label="电话">
  390. <template slot-scope="scope">
  391. <el-input v-model="scope.row.tel" :disabled="goodsForm.status !== 0" size="small"
  392. placeholder="请输入内容"></el-input>
  393. </template>
  394. </el-table-column>
  395. <el-table-column
  396. property="address"
  397. align="center"
  398. label="详细地址">
  399. <template slot-scope="scope">
  400. <el-input v-model="scope.row.address" :disabled="goodsForm.status !== 0" size="small"
  401. placeholder="请输入内容"></el-input>
  402. </template>
  403. </el-table-column>
  404. <el-table-column
  405. property="remarks"
  406. align="center"
  407. label="备注">
  408. <template slot-scope="scope">
  409. <el-input v-model="scope.row.remarks" :disabled="goodsForm.status !== 0" size="small"
  410. placeholder="请输入内容"></el-input>
  411. </template>
  412. </el-table-column>
  413. <el-table-column
  414. align="center"
  415. width="40">
  416. <template slot-scope="scope">
  417. <div v-if="scope.$index !== tableData.length-1" style="margin: -5px auto">
  418. <el-tooltip class="item" effect="dark" content="向上移动" placement="right" v-if="scope.$index > 1">
  419. <div class="single" style="margin-bottom: -5px">
  420. <el-button type="text" style="margin-right: -0.5rem" icon="el-icon-arrow-up" size="mini" @click="moveUp(scope.row,scope.$index)"></el-button>
  421. </div>
  422. </el-tooltip>
  423. <el-tooltip class="item" effect="dark" content="向下移动" placement="right" v-if="scope.$index > 0 && scope.$index < tableData.length-2">
  424. <div class="single" style="margin-top: -5px">
  425. <el-button type="text" style="margin-right: -0.5rem" icon="el-icon-arrow-down" size="mini" @click="moveDown(scope.row,scope.$index)"></el-button>
  426. </div>
  427. </el-tooltip>
  428. </div>
  429. </template>
  430. </el-table-column>
  431. </el-table>
  432. </trade-card>
  433. <trade-card title="车辆信息">
  434. <avue-crud
  435. :data="vehicleList"
  436. ref="crudContact"
  437. v-if="keyContact>0"
  438. @resetColumn="resetColumnContact"
  439. @saveColumn="saveColumnContact"
  440. :option="vehicleOption">
  441. <template slot="plateNo" slot-scope="{row}">
  442. <span class="el-button--text" style="cursor: pointer"
  443. @click="openTrack(row)">{{ row.plateNo }}</span>
  444. </template>
  445. </avue-crud>
  446. </trade-card>
  447. <trade-card title="杂费明细">
  448. <el-tabs v-model="activeIndex" @tab-click="handleSelect">
  449. <el-tab-pane label="应收" name="1"></el-tab-pane>
  450. <!-- <el-tab-pane label="应付" name="2"></el-tab-pane>-->
  451. </el-tabs>
  452. <avue-crud
  453. v-if="activeIndex === '1'"
  454. :data="collectionList"
  455. :option="collectionOption"
  456. ref="collection"
  457. @resetColumn="resetColumnCollection"
  458. @saveColumn="saveColumnCollection"
  459. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  460. @row-update="rowSave"
  461. @row-del="makeDel">
  462. <template slot-scope="{row}" slot="corpId">
  463. <crop-select
  464. v-if="row.$cellEdit"
  465. v-model="row.corpId"
  466. :disabled="goodsForm.status !== 0"
  467. @getCorpData="(data)=>{getfleetId(data,row)}"
  468. ></crop-select>
  469. <span v-else>{{ row.corpName }}</span>
  470. </template>
  471. <template slot-scope="{row}" slot="feeId">
  472. <breakdown-select
  473. v-if="row.$cellEdit"
  474. v-model="row.feeId"
  475. :disabled="goodsForm.status !== 0"
  476. @selectValue="(value) => selectValue(value,row)"
  477. :configuration="breakConfiguration"
  478. >
  479. </breakdown-select>
  480. <span v-else>{{ row.feeName }}</span>
  481. </template>
  482. <template slot-scope="{row,index}" slot="menu">
  483. <!-- <el-button-->
  484. <!-- type="text"-->
  485. <!-- size="small"-->
  486. <!-- :disabled="goodsForm.status === 1"-->
  487. <!-- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
  488. <!-- @click="rowCell(row,index)"-->
  489. <!-- >{{ row.$cellEdit ? '保存' : '编辑' }}-->
  490. <!-- </el-button>-->
  491. <!-- <el-button type="text"-->
  492. <!-- icon="el-icon-delete"-->
  493. <!-- size="small"-->
  494. <!-- :disabled="goodsForm.status === 1"-->
  495. <!-- @click="$refs.collection.rowDel(row,index)"-->
  496. <!-- >删除-->
  497. <!-- </el-button>-->
  498. <el-button
  499. size="small"
  500. type="text"
  501. icon="el-icon-s-order"
  502. @click="annexOpen(row, index)"
  503. >附 件
  504. </el-button>
  505. </template>
  506. <template slot="menuLeft">
  507. <!-- <el-button-->
  508. <!-- type="primary"-->
  509. <!-- icon="el-icon-plus"-->
  510. <!-- :disabled="goodsForm.status !== 0"-->
  511. <!-- @click="addRowCollection"-->
  512. <!-- size="small">录入明细</el-button>-->
  513. </template>
  514. </avue-crud>
  515. <avue-crud
  516. v-if="activeIndex === '2'"
  517. :data="paymentList"
  518. :option="paymentOption"
  519. ref="payment"
  520. @resetColumn="resetColumnPayment"
  521. @saveColumn="saveColumnPayment"
  522. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  523. @row-update="rowSave"
  524. @row-del="feeDel"
  525. >
  526. <template slot-scope="{row}" slot="corpId">
  527. <crop-select
  528. v-if="row.$cellEdit"
  529. v-model="row.corpId"
  530. :disabled="goodsForm.status === 1"
  531. @getCorpData="(data)=>{getfleetId(data,row)}"
  532. ></crop-select>
  533. <span v-else>{{ row.corpName }}</span>
  534. </template>
  535. <template slot-scope="{row}" slot="feeId">
  536. <breakdown-select
  537. v-if="row.$cellEdit"
  538. v-model="row.feeId"
  539. :disabled="goodsForm.status !== 0"
  540. @selectValue="(value) => selectValue(value,row)"
  541. :configuration="breakConfiguration"
  542. >
  543. </breakdown-select>
  544. <span v-else>{{ row.feeName }}</span>
  545. </template>
  546. <template slot-scope="{row,index}" slot="menu">
  547. <el-button
  548. type="text"
  549. size="small"
  550. :disabled="goodsForm.status === 1"
  551. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  552. @click="paymentRowCell(row,index)"
  553. >{{ row.$cellEdit ? '保存' : '编辑' }}
  554. </el-button>
  555. <el-button type="text"
  556. icon="el-icon-delete"
  557. size="small"
  558. :disabled="goodsForm.status === 1"
  559. @click="$refs.payment.rowDel(row,index)"
  560. >删除
  561. </el-button>
  562. </template>
  563. <template slot="menuLeft">
  564. <el-button
  565. type="primary"
  566. icon="el-icon-plus"
  567. :disabled="goodsForm.status === 1"
  568. @click="addRowPayment"
  569. size="small">录入明细
  570. </el-button>
  571. </template>
  572. </avue-crud>
  573. </trade-card>
  574. <containerTitle title="上传附件"></containerTitle>
  575. <c-upload
  576. typeUpload="CD"
  577. deleteUrl="/api/blade-client/common-file/remove"
  578. :data="orderFilesList"
  579. display
  580. :enumerationValue="85.6"
  581. ></c-upload>
  582. <el-dialog
  583. title="附件"
  584. :visible.sync="enclosure"
  585. append-to-body
  586. width="70%">
  587. <c-upload
  588. typeUpload="GZ"
  589. :basic="true"
  590. deleteUrl="/api/blade-client/common-file/remove"
  591. :data="orderList"
  592. disabled
  593. :enumerationValue="76"
  594. ></c-upload>
  595. <span slot="footer" class="dialog-footer">
  596. <el-button @click="enclosure = false" size="small">取 消</el-button>
  597. </span>
  598. </el-dialog>
  599. <track-playback :dialogVisible="dialogVisible" :lineArr="lineArr" ref="playback"></track-playback>
  600. </div>
  601. </template>
  602. <script>
  603. import {getLazyTree} from "@/api/base/region";
  604. import {
  605. saveDelegationList,
  606. detailDelegationList,
  607. removeCollection,
  608. saveSaveList,
  609. addressList, cancelSubmission, getCorp, getSalesman, getFee, changeSubmission, validChange, tRemove
  610. } from "@/api/landTransportation";
  611. import {getDeptTree} from "@/api/system/dept";
  612. import website from "@/config/website";
  613. import {gaude, location} from "@/api/gaude";
  614. //地图回放
  615. import trackPlayback from "@/components/trackPlayback"
  616. export default {
  617. comments: {
  618. trackPlayback
  619. },
  620. props: {
  621. id: {
  622. type: String
  623. },
  624. home: {
  625. type: Boolean
  626. }
  627. },
  628. data() {
  629. return {
  630. returnButton: Boolean,
  631. dialogVisible: false,
  632. lineArr: [],
  633. activeIndex: '1',
  634. KeyBox: 0,
  635. KeyBoxTwo: 0,
  636. typeTwo: false,
  637. type: false,
  638. enclosure: false,
  639. orderList: [],
  640. goodsForm: {},
  641. modelKey: 1,
  642. orderFilesList: [],
  643. salesmanList: [],
  644. vehicleList: [],
  645. breakConfiguration: {
  646. multipleChoices: false,
  647. multiple: false,
  648. disabled: false,
  649. searchShow: true,
  650. collapseTags: false,
  651. clearable: true,
  652. placeholder: '请点击右边按钮选择',
  653. dicData: []
  654. },
  655. roleName: localStorage.getItem("roleName").split(','),
  656. advantageProjectData: [],
  657. keyContact: 0,
  658. vehicleOptionTwo: {
  659. align: 'center',
  660. menuAlign: 'center',
  661. refreshBtn: false,
  662. menu: false,
  663. index: true,
  664. stripe: true,
  665. cellBtn: false,
  666. addBtn: false,
  667. cancelBtn: false,
  668. editBtn: false,
  669. addRowBtn: false,
  670. delBtn: false,
  671. showSummary: true,
  672. // editBtn:false,
  673. summaryText: "合计",
  674. sumColumnList: [
  675. {
  676. name: 'landWeight',
  677. type: 'sum',
  678. decimals: 2
  679. }, {
  680. name: 'landAmountC',
  681. type: 'sum',
  682. decimals: 2
  683. }, {
  684. name: 'landAmountD',
  685. type: 'sum',
  686. decimals: 2
  687. }, {
  688. name: 'oneFeeD',
  689. type: 'sum',
  690. decimals: 2
  691. }, {
  692. name: 'twoFeeD',
  693. type: 'sum',
  694. decimals: 2
  695. }, {
  696. name: 'threeFeeD',
  697. type: 'sum',
  698. decimals: 2
  699. }, {
  700. name: 'fourFeeD',
  701. type: 'sum',
  702. decimals: 2
  703. }, {
  704. name: 'fiveFeeD',
  705. type: 'sum',
  706. decimals: 2
  707. }, {
  708. name: 'oneFeeC',
  709. type: 'sum',
  710. decimals: 2
  711. }, {
  712. name: 'twoFeeC',
  713. type: 'sum',
  714. decimals: 2
  715. }, {
  716. name: 'threeFeeC',
  717. type: 'sum',
  718. decimals: 2
  719. }, {
  720. name: 'fourFeeC',
  721. type: 'sum',
  722. decimals: 2
  723. }, {
  724. name: 'fiveFeeC',
  725. type: 'sum',
  726. decimals: 2
  727. }, {
  728. name: 'landAmountD',
  729. type: 'sum',
  730. decimals: 2
  731. }, {
  732. name: 'ctnQuantity',
  733. type: 'sum',
  734. decimals: 0
  735. }],
  736. column: [{
  737. label: '货运日期',
  738. type: "datetime",
  739. format: 'yyyy-MM-dd HH:mm',
  740. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  741. width: 200,
  742. index: 1,
  743. prop: 'arrivalTime'
  744. }, {
  745. label: '受理日期',
  746. type: "datetime",
  747. format: 'yyyy-MM-dd HH:mm',
  748. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  749. width: 200,
  750. index: 2,
  751. prop: 'acceptTime'
  752. }, {
  753. label: '实际到厂时间',
  754. prop: 'realArrivalTime',
  755. overHidden: true,
  756. type: "date",
  757. searchRange: true,
  758. defaultTime: ['00:00:00', '23:59:59'],
  759. format: "yyyy-MM-dd HH:mm",
  760. valueFormat: "yyyy-MM-dd HH:mm:ss",
  761. index: 3,
  762. width: 140,
  763. }, {
  764. label: '车队',
  765. width: 150,
  766. index: 4,
  767. prop: 'fleetShortName'
  768. }, {
  769. label: '车号',
  770. width: 150,
  771. index: 4,
  772. prop: 'plateNo'
  773. }, {
  774. label: '司机',
  775. width: 115,
  776. index: 5,
  777. prop: 'driverName'
  778. }, {
  779. label: '电话',
  780. width: 160,
  781. index: 6,
  782. prop: 'tel'
  783. }, {
  784. label: '完工日期',
  785. prop: 'finishedTime',
  786. overHidden: true,
  787. type: "date",
  788. searchRange: true,
  789. defaultTime: ['00:00:00', '23:59:59'],
  790. format: "yyyy-MM-dd HH:mm",
  791. valueFormat: "yyyy-MM-dd HH:mm:ss",
  792. index: 7,
  793. width: 140,
  794. }, {
  795. label: '箱型',
  796. width: 100,
  797. slot: true,
  798. index: 8,
  799. prop: 'ctnType'
  800. }, {
  801. label: '箱量',
  802. width: 50,
  803. index: 9,
  804. prop: 'ctnQuantity'
  805. }, {
  806. label: '货物名称',
  807. overHidden: true,
  808. width: 160,
  809. index: 10,
  810. prop: 'goods'
  811. }, {
  812. label: '件数',
  813. width: 100,
  814. overHidden: true,
  815. controls: false,
  816. cell: true,
  817. index: 11,
  818. prop: 'quantity',
  819. type: 'number',
  820. precision: 0
  821. }, {
  822. label: '重量',
  823. width: 160,
  824. prop: 'landWeight',
  825. controls: false,
  826. precision: 2,
  827. index: 12,
  828. type: 'number'
  829. }, {
  830. label: '尺码',
  831. width: 100,
  832. overHidden: true,
  833. index: 13,
  834. prop: 'size',
  835. }, {
  836. label: '委托备注',
  837. width: 245,
  838. index: 14,
  839. prop: 'remarks'
  840. }, {
  841. label: '状态',
  842. width: 100,
  843. index: 15,
  844. type: 'select',
  845. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
  846. props: {
  847. label: "dictValue",
  848. value: "dictKey"
  849. },
  850. dataType: "string",
  851. prop: 'status'
  852. }
  853. // {
  854. // label: '应付陆运费',
  855. // cell: true,
  856. // prop: 'landAmountC'
  857. // }
  858. // , {
  859. // label: '车队备注',
  860. // width: 245,
  861. // prop: 'fleetRemarks'
  862. // }, {
  863. // label: '司机备注',
  864. // width: 245,
  865. // prop: 'driverRemarks'
  866. // }
  867. ]
  868. },
  869. vehicleOption: {},
  870. treeOption: {
  871. label: 'title',
  872. value: 'id',
  873. lazy: true,
  874. lazyLoad(node, resolve) {
  875. const parentId = node.level === 0 ? '00' : node.data.id;
  876. getLazyTree(parentId).then(res => {
  877. resolve(
  878. res.data.data.map(item => {
  879. return {
  880. ...item,
  881. leaf: !item.hasChildren
  882. };
  883. })
  884. );
  885. });
  886. }
  887. },
  888. tableData: [],
  889. entrustListT: [],
  890. entrustOptionTwoTBackup: {
  891. align: 'center',
  892. menuAlign: 'center',
  893. index: true,
  894. cellBtn: true,
  895. menu: false,
  896. refreshBtn: false,
  897. addBtn: false,
  898. addRowBtn: false,
  899. delBtn: false,
  900. showSummary: true,
  901. summaryText: "合计",
  902. sumColumnList: [
  903. {
  904. name: 'landWeight',
  905. type: 'sum',
  906. decimals: 2
  907. }, {
  908. name: 'landAmountC',
  909. type: 'sum',
  910. decimals: 2
  911. }, {
  912. name: 'landAmountD',
  913. type: 'sum',
  914. decimals: 2
  915. }, {
  916. name: 'oneFeeD',
  917. type: 'sum',
  918. decimals: 2
  919. }, {
  920. name: 'twoFeeD',
  921. type: 'sum',
  922. decimals: 2
  923. }, {
  924. name: 'threeFeeD',
  925. type: 'sum',
  926. decimals: 2
  927. }, {
  928. name: 'fourFeeD',
  929. type: 'sum',
  930. decimals: 2
  931. }, {
  932. name: 'fiveFeeD',
  933. type: 'sum',
  934. decimals: 2
  935. }, {
  936. name: 'ctnQuantity',
  937. type: 'sum',
  938. decimals: 0
  939. }],
  940. column: [{
  941. label: '货运日期',
  942. type: "datetime",
  943. format: 'yyyy-MM-dd HH:mm',
  944. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  945. index: 1,
  946. cell: true,
  947. width: 200,
  948. prop: 'arrivalTime'
  949. }, {
  950. label: '箱型',
  951. width: 100,
  952. index: 2,
  953. prop: 'ctnType'
  954. }, {
  955. label: '箱量',
  956. width: 50,
  957. index: 3,
  958. prop: 'ctnQuantity'
  959. }, {
  960. label: '运费',
  961. prop: 'landAmountD',
  962. width: 100,
  963. precision: 2,
  964. index: 4,
  965. controls: false,
  966. }, {
  967. label: '件数',
  968. width: 100,
  969. index: 5,
  970. overHidden: true,
  971. controls: false,
  972. prop: 'quantity',
  973. type: 'number',
  974. precision: 0
  975. }, {
  976. label: '重量',
  977. width: 160,
  978. index: 6,
  979. prop: 'landWeight',
  980. controls: false,
  981. precision: 2,
  982. type: 'number'
  983. }
  984. // , {
  985. // label: '包装',
  986. // width: 100,
  987. // index: 7,
  988. // overHidden: true,
  989. // prop: 'packing',
  990. // type: 'select',
  991. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  992. // props: {
  993. // label: "dictValue",
  994. // value: "dictValue"
  995. // },
  996. // }
  997. , {
  998. label: '尺码',
  999. width: 100,
  1000. index: 8,
  1001. overHidden: true,
  1002. prop: 'size',
  1003. }, {
  1004. label: '货物名称',
  1005. width: 200,
  1006. index: 9,
  1007. overHidden: true,
  1008. prop: 'goods',
  1009. }, {
  1010. label: '备注',
  1011. width: 200,
  1012. index: 10,
  1013. prop: 'remarks'
  1014. }]
  1015. },
  1016. entrustOptionTwoT: {},
  1017. entrustList: [],
  1018. goodsOptionFormC: {
  1019. menuBtn: false,
  1020. disabled: false,
  1021. span: 8,
  1022. column: [{
  1023. label: '业务类型',
  1024. prop: 'businessType',
  1025. type: 'select',
  1026. dicUrl: "/api/blade-system/dict-biz/dictionary?code=business_type",
  1027. props: {
  1028. label: "dictValue",
  1029. value: "dictValue"
  1030. },
  1031. rules: [{
  1032. required: false,
  1033. message: " ",
  1034. trigger: "blur"
  1035. }]
  1036. }, {
  1037. label: '运输方式',
  1038. prop: 'shippingMode',
  1039. type: 'select',
  1040. dicUrl: "/api/blade-system/dict-biz/dictionary?code=shipping_mode",
  1041. props: {
  1042. label: "dictValue",
  1043. value: "dictValue"
  1044. },
  1045. disabled: true,
  1046. change: (data) => {
  1047. if (data.value === '集装箱') {
  1048. this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = true
  1049. } else if (!data.value) {
  1050. this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = true
  1051. } else {
  1052. this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = false
  1053. }
  1054. }
  1055. }, {
  1056. label: '平台号',
  1057. prop: 'orderNo',
  1058. disabled: true
  1059. }]
  1060. },
  1061. goodsOptionForm: {
  1062. menuBtn: false,
  1063. disabled: false,
  1064. span: 8,
  1065. column: [{
  1066. label: '公司名称',
  1067. formslot: true,
  1068. prop: 'corpId',
  1069. rules: [{
  1070. required: true,
  1071. message: " ",
  1072. trigger: "change"
  1073. }],
  1074. }, {
  1075. label: '所属部门',
  1076. prop: 'salesmanDept',
  1077. type: "tree",
  1078. filter: false,
  1079. dicData: [],
  1080. props: {
  1081. label: "title"
  1082. }
  1083. }, {
  1084. label: '业务员',
  1085. prop: 'salesman',
  1086. rules: [{
  1087. required: true,
  1088. message: " ",
  1089. trigger: "blur"
  1090. }]
  1091. }, {
  1092. label: '物流运输',
  1093. prop: 'dispatchDept',
  1094. dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
  1095. cascader: ['dispatcher'],
  1096. type: "select",
  1097. props: {
  1098. label: "deptName",
  1099. value: "id"
  1100. },
  1101. rules: [{
  1102. required: true,
  1103. message: " ",
  1104. trigger: "blur"
  1105. }]
  1106. }, {
  1107. label: '运输调度',
  1108. prop: 'dispatcher',
  1109. type: "select",
  1110. dicUrl: "/api/blade-user/userList?deptPid={{key}}",
  1111. props: {
  1112. label: "realName",
  1113. value: "id"
  1114. }
  1115. }, {
  1116. label: '委托日期',
  1117. prop: 'bsDate',
  1118. type: "datetime",
  1119. format: 'yyyy-MM-dd HH:mm',
  1120. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1121. }, {
  1122. label: '票据号',
  1123. prop: 'receiptNo'
  1124. }, {
  1125. label: '联系电话',
  1126. prop: 'tel'
  1127. }, {
  1128. label: '提单号',
  1129. prop: 'billNo',
  1130. rules: [{
  1131. required: true,
  1132. message: " ",
  1133. trigger: "blur"
  1134. }],
  1135. }, {
  1136. label: '场站',
  1137. prop: 'station',
  1138. rules: [{
  1139. required: true,
  1140. message: " ",
  1141. trigger: "blur"
  1142. }],
  1143. }
  1144. // , {
  1145. // label: '货运日期',
  1146. // type: "datetime",
  1147. // format: 'yyyy-MM-dd HH:mm:ss',
  1148. // valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1149. // prop: 'arrivalTime',
  1150. // rules: [{
  1151. // required: true,
  1152. // message: " ",
  1153. // trigger: "blur"
  1154. // }],
  1155. // }
  1156. , {
  1157. label: '备注',
  1158. span: 24,
  1159. minRows: 2,
  1160. prop: 'remarks',
  1161. type: 'textarea'
  1162. }]
  1163. },
  1164. goodsOptionFormTwo: {
  1165. menuBtn: false,
  1166. disabled: false,
  1167. span: 8,
  1168. column: [
  1169. // {
  1170. // label: '所属公司',
  1171. // formslot: true,
  1172. // prop: 'belongCompany',
  1173. // rules: [{
  1174. // required: false,
  1175. // message: " ",
  1176. // trigger: "blur"
  1177. // }],
  1178. // },
  1179. {
  1180. label: '船名航次',
  1181. prop: 'factory',
  1182. rules: [{
  1183. required: false,
  1184. message: " ",
  1185. trigger: "blur"
  1186. }],
  1187. }
  1188. // , {
  1189. // label: '货物名称',
  1190. // prop: 'goods',
  1191. // rules: [{
  1192. // required: false,
  1193. // message: " ",
  1194. // trigger: "blur"
  1195. // }],
  1196. // }
  1197. , {
  1198. label: '开船日期',
  1199. prop: 'etd',
  1200. type: 'date'
  1201. }, {
  1202. label: '预配箱量',
  1203. prop: 'expectCtnQty'
  1204. }, {
  1205. label: '起运港',
  1206. prop: 'polId'
  1207. }, {
  1208. label: '目的港',
  1209. prop: 'podId'
  1210. }, {
  1211. label: '截港日期',
  1212. prop: 'etc',
  1213. type: 'date'
  1214. }, {
  1215. label: '截单日期',
  1216. prop: 'siCutoffDate',
  1217. type: 'date'
  1218. }, {
  1219. label: '订舱代理',
  1220. prop: 'agentId'
  1221. }]
  1222. },
  1223. entrustOptionTwoBackup: {
  1224. align: 'center',
  1225. menuAlign: 'center',
  1226. refreshBtn: false,
  1227. addBtnText: '录入信息',
  1228. index: true,
  1229. indexSlot: true,
  1230. cellBtn: true,
  1231. addBtn: false,
  1232. addRowBtn: false,
  1233. showSummary: true,
  1234. summaryText: "合计",
  1235. sumColumnList: [
  1236. {
  1237. name: 'landWeight',
  1238. type: 'sum',
  1239. decimals: 2
  1240. }, {
  1241. name: 'landAmountD',
  1242. type: 'sum',
  1243. decimals: 2
  1244. }, {
  1245. name: 'oneFeeD',
  1246. type: 'sum',
  1247. decimals: 2
  1248. }, {
  1249. name: 'twoFeeD',
  1250. type: 'sum',
  1251. decimals: 2
  1252. }, {
  1253. name: 'threeFeeD',
  1254. type: 'sum',
  1255. decimals: 2
  1256. }, {
  1257. name: 'fourFeeD',
  1258. type: 'sum',
  1259. decimals: 2
  1260. }, {
  1261. name: 'fiveFeeD',
  1262. type: 'sum',
  1263. decimals: 2
  1264. }, {
  1265. name: 'ctnQuantity',
  1266. type: 'sum',
  1267. decimals: 0
  1268. }],
  1269. column: [{
  1270. label: '货运日期',
  1271. type: "datetime",
  1272. format: 'yyyy-MM-dd HH:mm',
  1273. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1274. cell: true,
  1275. width: 200,
  1276. index: 1,
  1277. prop: 'arrivalTime'
  1278. }, {
  1279. // label: '箱型',
  1280. label: '箱型',
  1281. cell: true,
  1282. prop: 'ctnType',
  1283. type: 'select',
  1284. width: 100,
  1285. index: 2,
  1286. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  1287. props: {
  1288. label: "dictValue",
  1289. value: "dictValue"
  1290. },
  1291. }, {
  1292. label: '箱量',
  1293. cell: true,
  1294. prop: 'ctnQuantity',
  1295. controls: false,
  1296. precision: 0,
  1297. index: 3,
  1298. width: 100,
  1299. maxRows: 999,
  1300. minRows: 1,
  1301. type: 'number'
  1302. }, {
  1303. label: '运费',
  1304. cell: true,
  1305. prop: 'landAmountD',
  1306. controls: false,
  1307. width: 200,
  1308. index: 4,
  1309. precision: 2,
  1310. type: 'number'
  1311. }, {
  1312. label: '件数',
  1313. width: 100,
  1314. index: 5,
  1315. overHidden: true,
  1316. controls: false,
  1317. cell: true,
  1318. prop: 'quantity',
  1319. type: 'number',
  1320. precision: 0
  1321. }, {
  1322. label: '重量(吨)',
  1323. cell: true,
  1324. prop: 'landWeight',
  1325. controls: false,
  1326. width: 200,
  1327. index: 6,
  1328. precision: 2,
  1329. type: 'number'
  1330. }
  1331. // , {
  1332. // label: '包装',
  1333. // width: 100,
  1334. // index: 7,
  1335. // overHidden: true,
  1336. // cell: true,
  1337. // prop: 'packing',
  1338. // type: 'select',
  1339. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  1340. // props: {
  1341. // label: "dictValue",
  1342. // value: "dictValue"
  1343. // },
  1344. // }
  1345. , {
  1346. label: '尺码',
  1347. width: 100,
  1348. index: 8,
  1349. overHidden: true,
  1350. cell: true,
  1351. prop: 'size',
  1352. }, {
  1353. label: '货物名称',
  1354. width: 200,
  1355. index: 9,
  1356. overHidden: true,
  1357. cell: true,
  1358. prop: 'goods',
  1359. }, {
  1360. label: '备注',
  1361. cell: true,
  1362. index: 10,
  1363. width: 200,
  1364. prop: 'remarks'
  1365. }]
  1366. },
  1367. entrustOptionTwo: {},
  1368. collectionList: [],
  1369. collectionOptionBackup: {
  1370. align: 'center',
  1371. menuAlign: 'center',
  1372. refreshBtn: false,
  1373. index: true,
  1374. // menu:false,
  1375. cancelBtn: false,
  1376. editBtn: false,
  1377. delBtn: false,
  1378. cellBtn: false,
  1379. addBtn: false,
  1380. addRowBtn: false,
  1381. showSummary: true,
  1382. addBtnText: '录入明细',
  1383. summaryText: "合计",
  1384. sumColumnList: [{
  1385. name: 'price',
  1386. type: 'sum',
  1387. decimals: 2
  1388. }, {
  1389. name: 'amount',
  1390. type: 'sum',
  1391. decimals: 2
  1392. }, {
  1393. name: 'quantity',
  1394. type: 'sum',
  1395. decimals: 0
  1396. }],
  1397. column: [{
  1398. label: '公司名称',
  1399. slot: true,
  1400. width: 300,
  1401. overHidden: true,
  1402. prop: 'corpId'
  1403. }, {
  1404. label: '车号',
  1405. cell: true,
  1406. prop: 'plateNo',
  1407. type: "select",
  1408. props: {
  1409. label: "label",
  1410. value: "label"
  1411. },
  1412. }, {
  1413. label: '费用名称',
  1414. slot: true,
  1415. width: 200,
  1416. prop: 'feeId'
  1417. }, {
  1418. label: '计价单位',
  1419. cell: true,
  1420. prop: 'unit',
  1421. type: "select",
  1422. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  1423. props: {
  1424. label: "dictValue",
  1425. value: "dictKey"
  1426. }
  1427. }, {
  1428. label: '单价',
  1429. cell: true,
  1430. prop: 'price'
  1431. }, {
  1432. label: '数量',
  1433. cell: true,
  1434. prop: 'quantity'
  1435. }, {
  1436. label: '金额',
  1437. cell: true,
  1438. prop: 'amount'
  1439. }, {
  1440. // label: '税率(默认6)',
  1441. label: '税率',
  1442. cell: true,
  1443. prop: 'taxRate'
  1444. }, {
  1445. label: '币别',
  1446. cell: true,
  1447. prop: 'currency',
  1448. type: "select",
  1449. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  1450. props: {
  1451. label: "dictValue",
  1452. value: "dictKey"
  1453. },
  1454. }
  1455. ]
  1456. },
  1457. paymentList: [],
  1458. collectionOption: {},
  1459. paymentOption: {},
  1460. paymentOptionBackup: {
  1461. align: 'center',
  1462. menuAlign: 'center',
  1463. index: true,
  1464. cancelBtn: false,
  1465. refreshBtn: false,
  1466. editBtn: false,
  1467. delBtn: false,
  1468. cellBtn: false,
  1469. addBtn: false,
  1470. addRowBtn: false,
  1471. showSummary: true,
  1472. addBtnText: '录入明细',
  1473. summaryText: "合计",
  1474. sumColumnList: [{
  1475. name: 'price',
  1476. type: 'sum',
  1477. decimals: 2
  1478. }, {
  1479. name: 'amount',
  1480. type: 'sum',
  1481. decimals: 2
  1482. }, {
  1483. name: 'quantity',
  1484. type: 'sum',
  1485. decimals: 0
  1486. }],
  1487. column: [{
  1488. label: '公司名称',
  1489. width: 200,
  1490. slot: true,
  1491. overHidden: true,
  1492. prop: 'corpId'
  1493. }, {
  1494. label: '费用名称',
  1495. slot: true,
  1496. prop: 'feeId'
  1497. }, {
  1498. label: '计价单位',
  1499. cell: true,
  1500. prop: 'unit',
  1501. type: "select",
  1502. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  1503. props: {
  1504. label: "dictValue",
  1505. value: "dictKey"
  1506. }
  1507. }, {
  1508. label: '数量',
  1509. cell: true,
  1510. prop: 'quantity'
  1511. }, {
  1512. label: '单价',
  1513. cell: true,
  1514. prop: 'price'
  1515. }, {
  1516. label: '金额',
  1517. cell: true,
  1518. prop: 'amount'
  1519. }, {
  1520. // label: '税率(默认6)',
  1521. label: '税率',
  1522. cell: true,
  1523. prop: 'taxRate'
  1524. }, {
  1525. label: '币别',
  1526. cell: true,
  1527. prop: 'currency',
  1528. type: "select",
  1529. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  1530. props: {
  1531. label: "dictValue",
  1532. value: "dictKey"
  1533. }
  1534. }]
  1535. }
  1536. };
  1537. },
  1538. async created() {
  1539. this.entrustOptionTwo = await this.getColumnData(this.getColumnName(85.1), this.entrustOptionTwoBackup);
  1540. this.KeyBox++
  1541. this.entrustOptionTwoT = await this.getColumnData(this.getColumnName(85.2), this.entrustOptionTwoTBackup);
  1542. this.KeyBoxTwo++
  1543. this.vehicleOption = await this.getColumnData(this.getColumnName(85.3), this.vehicleOptionTwo);
  1544. this.keyContact++
  1545. this.collectionOption = await this.getColumnData(this.getColumnName(85.4), this.collectionOptionBackup);
  1546. this.paymentOption = await this.getColumnData(this.getColumnName(85.5), this.paymentOptionBackup);
  1547. if (this.id) {
  1548. if (this.id.slice(0, 4) === 'copy') {
  1549. detailDelegationList({id: this.id.slice(4, this.id.length), kind: '1'}).then(res => {
  1550. this.goodsForm = res.data.data
  1551. this.tableData = res.data.data.orderAddressList
  1552. this.entrustList = res.data.data.itemList
  1553. this.goodsList = res.data.data.itemList
  1554. this.vehicleList = res.data.data.orderItemList
  1555. this.orderFilesList = res.data.data.fileList
  1556. this.goodsForm.status = 0
  1557. if (res.data.data.orderFeeList.length > 0) {
  1558. res.data.data.orderFeeList.forEach(item => {
  1559. if (item.type == 1) {
  1560. this.collectionList.push(item)
  1561. } else {
  1562. this.paymentList.push(item)
  1563. }
  1564. })
  1565. }
  1566. this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status !== 0
  1567. delete this.goodsForm.orderAddressList
  1568. delete this.goodsForm.itemList
  1569. delete this.goodsForm.orderFeeList
  1570. this.goodsForm.id = ''
  1571. this.tableData.forEach(item => item.id = '')
  1572. this.entrustList.forEach(item => item.id = '')
  1573. this.goodsList.forEach(item => item.id = '')
  1574. this.vehicleList.forEach(item => item.id = '')
  1575. this.orderFilesList.forEach(item => item.id = '')
  1576. //查询业务员
  1577. this.salesmanQuery()
  1578. if (this.goodsForm.status == 2) {
  1579. if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('总调度') !== -1) {
  1580. this.goodsForm.status = 2
  1581. }
  1582. }
  1583. })
  1584. } else if (this.id.slice(0, 2) === '首页' || this.id.slice(0, 2) === '台账') {
  1585. if (this.id.slice(0, 2) === '首页') {
  1586. this.returnButton = true
  1587. } else {
  1588. this.returnButton = false
  1589. }
  1590. detailDelegationList({id: this.id.slice(2, this.id.length), kind: '1'}).then(res => {
  1591. this.goodsForm = res.data.data
  1592. this.tableData = res.data.data.orderAddressList
  1593. this.entrustList = res.data.data.itemList
  1594. this.goodsList = res.data.data.itemList
  1595. this.vehicleList = res.data.data.orderItemList
  1596. this.orderFilesList = res.data.data.fileList
  1597. if (res.data.data.orderFeeList.length > 0) {
  1598. res.data.data.orderFeeList.forEach(item => {
  1599. if (item.type == 1) {
  1600. this.collectionList.push(item)
  1601. } else {
  1602. this.paymentList.push(item)
  1603. }
  1604. })
  1605. }
  1606. this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status !== 0
  1607. delete this.goodsForm.orderAddressList
  1608. delete this.goodsForm.itemList
  1609. delete this.goodsForm.orderFeeList
  1610. // this.tableData.forEach(item => {
  1611. // if (item.region) item.region = item.region.split(',')
  1612. // })
  1613. //查询业务员
  1614. this.salesmanQuery()
  1615. if (this.goodsForm.status == 2) {
  1616. if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('总调度') !== -1) {
  1617. this.goodsForm.status = 2
  1618. }
  1619. }
  1620. })
  1621. } else {
  1622. detailDelegationList({id: this.id, kind: '1'}).then(res => {
  1623. this.goodsForm = res.data.data
  1624. this.tableData = res.data.data.orderAddressList
  1625. this.entrustList = res.data.data.itemList
  1626. this.goodsList = res.data.data.itemList
  1627. this.vehicleList = res.data.data.orderItemList
  1628. this.orderFilesList = res.data.data.fileList
  1629. if (res.data.data.orderFeeList.length > 0) {
  1630. res.data.data.orderFeeList.forEach(item => {
  1631. if (item.type == 1) {
  1632. this.collectionList.push(item)
  1633. } else {
  1634. this.paymentList.push(item)
  1635. }
  1636. })
  1637. }
  1638. this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status !== 0
  1639. delete this.goodsForm.orderAddressList
  1640. delete this.goodsForm.itemList
  1641. delete this.goodsForm.orderFeeList
  1642. // this.tableData.forEach(item => {
  1643. // if (item.region) item.region = item.region.split(',')
  1644. // })
  1645. //查询业务员
  1646. this.salesmanQuery()
  1647. if (this.goodsForm.status == 2){
  1648. if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1) {
  1649. this.goodsForm.status = 2
  1650. }
  1651. }
  1652. })
  1653. }
  1654. } else {
  1655. this.tableData = [{}, {}]
  1656. getCorp().then(res => {
  1657. this.goodsForm = {
  1658. corpId: res.data.data ? res.data.data.id : '',
  1659. businessType: "出口",
  1660. shippingMode: "集装箱",
  1661. status: 0,
  1662. salesman: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id,
  1663. belongCompany: res.data.data ? res.data.data.belongCompany : '',
  1664. bsDate: new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19)//获取当天时间并格式化
  1665. }
  1666. this.salesmanQuery('', true)
  1667. })
  1668. this.entrustList = []
  1669. }
  1670. // 非租户模式默认加载管理组数据
  1671. if (!website.tenantMode) {
  1672. this.initData(website.tenantId);
  1673. } else {
  1674. this.initData();
  1675. }
  1676. this.$refs.other.show = false
  1677. },
  1678. methods: {
  1679. openTrack(row) {
  1680. gaude({itemId: row.id, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  1681. this.lineArr = res.data.data.trackArray
  1682. this.dialogVisible = true
  1683. let this_ = this
  1684. setTimeout(function () {
  1685. this_.$refs.playback.initMap();
  1686. }, 100)
  1687. })
  1688. // location({itemId: row.id,plateNo:'陕YH0008'}).then(res => {
  1689. // // console.log(res.data.data)
  1690. // // console.log(this.lineArr[this.lineArr.length - 1])
  1691. // })
  1692. },
  1693. getCropId(row){
  1694. if (row){
  1695. this.goodsForm.corpId = row.id
  1696. this.goodsForm.corpName = row.cname
  1697. this.goodsForm.belongCompany = row.belongCompany
  1698. this.goodsForm.salesman = ''
  1699. //查询业务员
  1700. this.salesmanQuery()
  1701. }
  1702. },
  1703. changeSelect(val) {
  1704. for (let item of this.salesmanList) {
  1705. if (item.id == val) {
  1706. this.goodsForm.salesmanDept = item.deptId.split(',')[0]
  1707. this.goodsForm.tel = item.phone
  1708. }
  1709. }
  1710. },
  1711. initData(tenantId) {
  1712. getDeptTree(tenantId).then(res => {
  1713. const column = this.findObject(this.goodsOptionForm.column, "salesmanDept");
  1714. column.dicData = res.data.data;
  1715. });
  1716. },
  1717. //查询业务员
  1718. salesmanQuery(realName, type) {
  1719. getSalesman({realName: realName, userExt: this.goodsForm.corpId}).then(res => {
  1720. this.salesmanList = res.data.data
  1721. if (type) {
  1722. this.changeSelect(this.goodsForm.salesman)
  1723. }
  1724. })
  1725. },
  1726. //自定义列保存
  1727. async saveColumnCollection() {
  1728. /**
  1729. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1730. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1731. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1732. */
  1733. const inSave = await this.saveColumnData(this.getColumnName(85.4), this.collectionOption);
  1734. if (inSave) {
  1735. this.$message.success("保存成功");
  1736. //关闭窗口
  1737. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1738. }
  1739. },
  1740. //自定义列重置
  1741. async resetColumnCollection() {
  1742. this.collectionOption = this.collectionOptionBackup;
  1743. const inSave = await this.delColumnData(this.getColumnName(85.4), this.collectionOptionBackup);
  1744. if (inSave) {
  1745. this.$message.success("重置成功");
  1746. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1747. }
  1748. },
  1749. //自定义列保存
  1750. async saveColumnPayment() {
  1751. /**
  1752. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1753. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1754. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1755. */
  1756. const inSave = await this.saveColumnData(this.getColumnName(85.5), this.paymentOption);
  1757. if (inSave) {
  1758. this.$message.success("保存成功");
  1759. //关闭窗口
  1760. this.$refs.payment.$refs.dialogColumn.columnBox = false;
  1761. }
  1762. },
  1763. //自定义列重置
  1764. async resetColumnPayment() {
  1765. this.paymentOption = this.paymentOptionBackup;
  1766. const inSave = await this.delColumnData(this.getColumnName(85.5), this.paymentOptionBackup);
  1767. if (inSave) {
  1768. this.$message.success("重置成功");
  1769. this.$refs.payment.$refs.dialogColumn.columnBox = false;
  1770. }
  1771. },
  1772. //自定义列保存
  1773. async saveColumnBox() {
  1774. /**
  1775. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1776. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1777. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1778. */
  1779. const inSave = await this.saveColumnData(this.getColumnName(85.1), this.entrustOptionTwo);
  1780. if (inSave) {
  1781. this.$message.success("保存成功");
  1782. //关闭窗口
  1783. this.$refs.crudBox.$refs.dialogColumn.columnBox = false;
  1784. }
  1785. },
  1786. //自定义列重置
  1787. async resetColumnBox() {
  1788. this.entrustOptionTwo = this.entrustOptionTwoBackup;
  1789. const inSave = await this.delColumnData(this.getColumnName(85.1), this.entrustOptionTwoBackup);
  1790. if (inSave) {
  1791. this.$message.success("重置成功");
  1792. this.$refs.crudBox.$refs.dialogColumn.columnBox = false;
  1793. }
  1794. },
  1795. //自定义列保存
  1796. async saveColumnBoxTwo() {
  1797. /**
  1798. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1799. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1800. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1801. */
  1802. const inSave = await this.saveColumnData(this.getColumnName(85.2), this.entrustOptionTwoT);
  1803. if (inSave) {
  1804. this.$message.success("保存成功");
  1805. //关闭窗口
  1806. this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
  1807. }
  1808. },
  1809. //自定义列重置
  1810. async resetColumnBoxTwo() {
  1811. this.entrustOptionTwoT = this.entrustOptionTwoTBackup;
  1812. const inSave = await this.delColumnData(this.getColumnName(85.2), this.entrustOptionTwoTBackup);
  1813. if (inSave) {
  1814. this.$message.success("重置成功");
  1815. this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
  1816. }
  1817. },
  1818. //自定义列保存
  1819. async saveColumnContact() {
  1820. /**
  1821. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1822. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1823. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1824. */
  1825. const inSave = await this.saveColumnData(this.getColumnName(85.3), this.vehicleOption);
  1826. if (inSave) {
  1827. this.$message.success("保存成功");
  1828. //关闭窗口
  1829. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1830. }
  1831. },
  1832. //自定义列重置
  1833. async resetColumnContact() {
  1834. this.vehicleOption = this.vehicleOptionTwo;
  1835. const inSave = await this.delColumnData(this.getColumnName(85.3), this.vehicleOptionTwo);
  1836. if (inSave) {
  1837. this.$message.success("重置成功");
  1838. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1839. }
  1840. },
  1841. //刷新数据
  1842. refreshData(id) {
  1843. let ids = ''
  1844. if (id){
  1845. ids = id
  1846. }else {
  1847. ids = this.id
  1848. }
  1849. detailDelegationList({id: ids, kind: '1'}).then(res => {
  1850. this.goodsForm = res.data.data
  1851. this.tableData = res.data.data.orderAddressList
  1852. this.entrustList = res.data.data.itemList
  1853. this.goodsList = res.data.data.itemList
  1854. this.vehicleList = res.data.data.orderItemList
  1855. this.orderFilesList = res.data.data.fileList
  1856. if (res.data.data.orderFeeList.length > 0) {
  1857. this.collectionList = []
  1858. this.paymentList = []
  1859. res.data.data.orderFeeList.forEach(item => {
  1860. if (item.type == 1) {
  1861. this.collectionList.push(item)
  1862. } else {
  1863. this.paymentList.push(item)
  1864. }
  1865. })
  1866. }
  1867. this.goodsOptionFormC.disabled = true
  1868. this.goodsOptionForm.disabled = true
  1869. this.goodsOptionFormTwo.disabled = true
  1870. this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status >= 1
  1871. delete this.goodsForm.orderAddressList
  1872. delete this.goodsForm.itemList
  1873. delete this.goodsForm.orderFeeList
  1874. // this.tableData.forEach(item => {
  1875. // if (item.region) item.region = item.region.split(',')
  1876. // })
  1877. this.type = false
  1878. })
  1879. },
  1880. //切换收付费
  1881. handleSelect(tab, event) {
  1882. this.activeIndex = tab.name
  1883. },
  1884. //箱信息保存
  1885. rowSaveT(row, index, done, loading) {
  1886. row.$cellEdit = false
  1887. done()
  1888. },
  1889. //箱信息选择车队
  1890. getfleetIdT(data, row) {
  1891. this.$set(row, 'fleetName', data.cname)
  1892. },
  1893. //地址新增
  1894. addAddress() {
  1895. this.tableData.splice(this.tableData.length - 1, 0, {})
  1896. },
  1897. moveUp(row,index){
  1898. this.tableData[index] = this.tableData.splice(index -1 ,1,row)[0]
  1899. },
  1900. moveDown(row,index){
  1901. this.tableData[index] = this.tableData.splice(index +1 ,1,row)[0]
  1902. },
  1903. //返回主列表
  1904. backToList(value) {
  1905. if (value === 0) {
  1906. this.goodsForm = {}
  1907. this.$emit('backToList')
  1908. } else if (value === 1) {
  1909. this.goodsForm = {}
  1910. this.$emit('backToList', true)
  1911. } else if (value === 2) {
  1912. this.$router.push({
  1913. path: '/wel/index'
  1914. });
  1915. } else if (value === 3) {
  1916. this.$router.push({
  1917. path: '/landTransportation/reportAnalysis/index'
  1918. });
  1919. }
  1920. },
  1921. //删除途径地址
  1922. deleteAddress(scope) {
  1923. if (scope.row.id) {
  1924. tRemove({ids: scope.row.id}).then(res => {
  1925. this.tableData.splice(scope.$index, 1);
  1926. })
  1927. } else {
  1928. this.tableData.splice(scope.$index, 1);
  1929. }
  1930. },
  1931. //箱信息保存
  1932. rowSave(row, index, done, loading) {
  1933. row.$cellEdit = false
  1934. done()
  1935. },
  1936. rowCell(row, index) {
  1937. this.$refs.collection.rowCell(row, index)
  1938. },
  1939. paymentRowCell(row, index) {
  1940. this.$refs.payment.rowCell(row, index)
  1941. },
  1942. //箱信息移除
  1943. rowDel(row, index) {
  1944. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  1945. confirmButtonText: '确定',
  1946. cancelButtonText: '取消',
  1947. type: 'warning'
  1948. }).then(() => {
  1949. this.entrustList.splice(index, 1);
  1950. }).catch(() => {
  1951. this.$message({
  1952. type: 'info',
  1953. message: '已取消删除'
  1954. });
  1955. });
  1956. },
  1957. //保存
  1958. editCustomer() {
  1959. let data = JSON.parse(JSON.stringify(this.tableData))
  1960. data.forEach((item, index) => {
  1961. item.sort = index + 1
  1962. // if (item.region !== undefined && item.region.length !== 0) {
  1963. // item.region = item.region.join(',')
  1964. // } else {
  1965. // item.region = ''
  1966. // }
  1967. })
  1968. this.type = true
  1969. saveSaveList({
  1970. ...this.goodsForm,
  1971. kind: '1',
  1972. orderAddressList: data,
  1973. fileList: this.orderFilesList,
  1974. itemList: this.entrustList,
  1975. orderFeeList: this.collectionList.concat(this.paymentList)
  1976. }).then(res => {
  1977. this.$message.success('保存成功');
  1978. if (!this.goodsForm.id) {
  1979. this.id = res.data.data
  1980. this.refreshData()
  1981. } else {
  1982. this.refreshData()
  1983. }
  1984. })
  1985. },
  1986. //确认变更
  1987. confirmChange() {
  1988. // validChange({id:this.id}).then(res => {
  1989. // if (res.data.data){
  1990. this.goodsForm.status = 0
  1991. this.goodsOptionFormC.disabled = false
  1992. this.goodsOptionForm.disabled = false
  1993. this.goodsOptionFormTwo.disabled = false
  1994. this.typeTwo = true
  1995. // }else {
  1996. // this.$message.error('不允许变更')
  1997. // }
  1998. // })
  1999. },
  2000. //变更保存
  2001. changeSaving() {
  2002. this.$refs['goodsFormE'].validate((valid, doneE) => {
  2003. doneE()
  2004. if (valid) {
  2005. this.$refs['goodsForm'].validate((valid, done) => {
  2006. done();
  2007. if (valid) {
  2008. for (let item in this.tableData) {
  2009. if (item < Number(this.tableData.length) - 1) {
  2010. if (!this.tableData[item].corpId) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行货运地点');
  2011. // if (!this.tableData[item].address) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行详细地址');
  2012. // if (!this.tableData[item].contacts) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行联系人');
  2013. // if (!this.tableData[item].tel) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行电话');
  2014. }
  2015. }
  2016. for (let item in this.entrustList) {
  2017. if (!this.entrustList[item].ctnType) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行箱型');
  2018. if (!this.entrustList[item].ctnQuantity) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行箱量');
  2019. if (!this.entrustList[item].arrivalTime) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行货运日期');
  2020. // if (!this.entrustList[item].landAmountD) return this.$message.error('请输入第' + Number(Number(item) + 1) + '运费');
  2021. }
  2022. if (this.entrustList.length === 0) return this.$message.error('箱信息不能为空')
  2023. let data = JSON.parse(JSON.stringify(this.tableData))
  2024. data.forEach((item, index) => {
  2025. item.sort = index + 1
  2026. })
  2027. this.type = true
  2028. let form = this.goodsForm
  2029. delete this.goodsForm.status
  2030. delete form.orderItemList
  2031. changeSubmission({
  2032. ...form,
  2033. kind: '1',
  2034. orderAddressList: data,
  2035. fileList: this.orderFilesList,
  2036. itemList: this.entrustList,
  2037. orderItemList: [],
  2038. orderFeeList: this.collectionList.concat(this.paymentList)
  2039. }).then(res => {
  2040. this.$message.success('保存成功');
  2041. this.typeTwo = false
  2042. this.refreshData()
  2043. })
  2044. } else {
  2045. return false;
  2046. }
  2047. });
  2048. } else {
  2049. return false;
  2050. }
  2051. })
  2052. },
  2053. //提交委托
  2054. submit(type) {
  2055. if (type) {
  2056. this.$refs['goodsFormE'].validate((valid, done) => {
  2057. done()
  2058. })
  2059. this.$refs['goodsForm'].validate((valid, done) => {
  2060. done()
  2061. })
  2062. for (let item in this.tableData) {
  2063. if (item < Number(this.tableData.length) - 1) {
  2064. if (!this.tableData[item].corpId) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行货运地点');
  2065. // if (!this.tableData[item].address) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行详细地址');
  2066. // if (!this.tableData[item].contacts) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行联系人');
  2067. // if (!this.tableData[item].tel) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行电话');
  2068. }
  2069. }
  2070. for (let item in this.entrustList) {
  2071. if (!this.entrustList[item].ctnType) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行箱型');
  2072. if (!this.entrustList[item].ctnQuantity) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行箱量');
  2073. if (!this.entrustList[item].arrivalTime) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行货运日期');
  2074. // if (!this.entrustList[item].landAmountD) return this.$message.error('请输入第' + Number(Number(item) + 1) + '运费');
  2075. }
  2076. if (this.entrustList.length === 0) return this.$message.error('箱信息不能为空')
  2077. this.$refs['goodsFormE'].validate((valid, doneE) => {
  2078. doneE()
  2079. if (valid) {
  2080. this.$refs['goodsForm'].validate((valid, done) => {
  2081. done();
  2082. if (valid) {
  2083. let data = JSON.parse(JSON.stringify(this.tableData))
  2084. data.forEach((item, index) => {
  2085. item.sort = index + 1
  2086. // if (item.region.length !== 0) {
  2087. // item.region = item.region.join(',')
  2088. // } else {
  2089. // item.region = ''
  2090. // }
  2091. })
  2092. this.entrustList.forEach(item => {
  2093. if (!item.arrivalTime) {
  2094. item.arrivalTime = this.goodsForm.arrivalTime
  2095. }
  2096. })
  2097. this.type = true
  2098. saveSaveList({
  2099. ...this.goodsForm,
  2100. kind: '1',
  2101. orderAddressList: data,
  2102. fileList: this.orderFilesList,
  2103. itemList: this.entrustList,
  2104. orderFeeList: this.collectionList.concat(this.paymentList)
  2105. }).then(res => {
  2106. saveDelegationList({
  2107. id: res.data.data
  2108. }).then(() => {
  2109. this.type = false
  2110. this.$message.success('提交成功');
  2111. this.refreshData(res.data.data)
  2112. }).finally(()=>{
  2113. this.type = false
  2114. })
  2115. })
  2116. } else {
  2117. return false;
  2118. }
  2119. });
  2120. } else {
  2121. return false;
  2122. }
  2123. })
  2124. } else {
  2125. cancelSubmission({
  2126. id: this.goodsForm.id
  2127. }).then(res => {
  2128. this.$message.success('取消成功');
  2129. this.refreshData()
  2130. })
  2131. }
  2132. },
  2133. //收费新增
  2134. addRowCollection() {
  2135. this.$refs.collection.rowCellAdd({
  2136. currency: '1',
  2137. type: '1',
  2138. $cellEdit: true
  2139. });
  2140. },
  2141. //打开附件
  2142. annexOpen(row, index) {
  2143. this.enclosure = true
  2144. getFee({id: row.id}).then(res => {
  2145. this.orderList = res.data.data
  2146. })
  2147. },
  2148. //付费新增
  2149. addRowPayment() {
  2150. this.$refs.payment.rowCellAdd({
  2151. currency: '1',
  2152. type: '2',
  2153. $cellEdit: true
  2154. });
  2155. },
  2156. //选择费用
  2157. selectValue(value, row) {
  2158. this.$set(row, 'feeName', value.cname)
  2159. },
  2160. //选择客户信息触发
  2161. getfleetId(data, row) {
  2162. this.$set(row, 'corpName', data.cname)
  2163. },
  2164. //收款信息移除
  2165. makeDel(row, index) {
  2166. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  2167. confirmButtonText: '确定',
  2168. cancelButtonText: '取消',
  2169. type: 'warning'
  2170. }).then(() => {
  2171. if (row.id) removeCollection(row.id)
  2172. this.collectionList.splice(index, 1);
  2173. }).catch(() => {
  2174. this.$message({
  2175. type: 'info',
  2176. message: '已取消删除'
  2177. });
  2178. });
  2179. },
  2180. //付款信息移除
  2181. feeDel(row, index) {
  2182. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  2183. confirmButtonText: '确定',
  2184. cancelButtonText: '取消',
  2185. type: 'warning'
  2186. }).then(() => {
  2187. if (row.id) removeCollection(row.id)
  2188. this.paymentList.splice(index, 1);
  2189. }).catch(() => {
  2190. this.$message({
  2191. type: 'info',
  2192. message: '已取消删除'
  2193. });
  2194. });
  2195. },
  2196. //选择公司名称带出所属公司
  2197. getCorpData(row) {
  2198. this.goodsForm.belongCompany = row.belongCompany
  2199. this.goodsForm.salesman = ''
  2200. //查询业务员
  2201. this.salesmanQuery()
  2202. },
  2203. clear(row) {
  2204. row.corpName = ''
  2205. },
  2206. //选择地址客户带出地址
  2207. withAddress(row, scope) {
  2208. this.$set(this.tableData[scope.$index], 'contacts', row.attn)
  2209. this.$set(this.tableData[scope.$index], 'tel', row.tel)
  2210. this.$set(this.tableData[scope.$index], 'address', row.storageAddr)
  2211. // this.tableData[scope.$index].contacts = row.attn
  2212. // this.tableData[scope.$index].tel = row.tel
  2213. // this.tableData[scope.$index].address = row.storageAddr
  2214. if (!scope.row.key) scope.row.key = 0
  2215. this.$set(this.tableData[scope.$index], 'corpName', row.cname)
  2216. // this.tableData[scope.$index].corpName = row.cname
  2217. if (row.belongtoarea) {
  2218. addressList(row.belongtoarea.split(',')[0]).then(res => {
  2219. this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
  2220. scope.row.key++
  2221. })
  2222. }
  2223. },
  2224. //自定义表头
  2225. renderHeader(h) {
  2226. return (
  2227. <div>
  2228. <el-tooltip className="item" effect="dark" content="增加途径地址" placement="top">
  2229. <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={() => this.addAddress()}
  2230. style="margin-right: 1.25rem;"></el-button>
  2231. </el-tooltip>
  2232. </div>
  2233. )
  2234. },
  2235. //自定义表头
  2236. customTitle(h, {column, $index}) {
  2237. let text = column.label
  2238. return (
  2239. <div>
  2240. {{text}}<span style="color:#F56C6C">*</span>
  2241. </div>
  2242. )
  2243. }
  2244. }
  2245. }
  2246. </script>
  2247. <style scoped lang="scss">
  2248. ::v-deep .el-form-item {
  2249. margin-bottom: 8px;
  2250. }
  2251. ::v-deep .el-form-item__content {
  2252. line-height: 32px;
  2253. }
  2254. ::v-deep .el-card__body {
  2255. padding: 10px 15px;
  2256. font-size: 14px;
  2257. }
  2258. .single ::v-deep .el-button--mini{
  2259. padding: 0 0 !important;
  2260. }
  2261. </style>