detailPage.vue 88 KB

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