detailPage.vue 89 KB

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