detailPage.vue 82 KB

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