detailPage.vue 71 KB

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