tranManagementTransportEdit.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067
  1. // 编辑运输任务
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="12">
  6. <h2 class="bg-left title">编辑运输任务</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="returnsales()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <el-form
  25. ref="deptBudgetList"
  26. :rules="mainReportAdd"
  27. :model="deptBudgetList"
  28. >
  29. <ws-info-table class="el-table">
  30. <el-form-item label="任务编号" span="1" prop="taskNo" class="forlist">
  31. <el-input
  32. v-model="deptBudgetList.taskNo"
  33. placeholder="请输入任务编号"
  34. maxlength="20"
  35. size="small"
  36. ></el-input>
  37. </el-form-item>
  38. <el-form-item prop="taskType" label="任务类型" span="1">
  39. <el-select
  40. v-model="deptBudgetList.taskType"
  41. placeholder="请输入任务类型"
  42. @change="selecttaskType"
  43. >
  44. <el-option
  45. v-for="item in taskType"
  46. :key="item.constKey"
  47. :label="item.constValue"
  48. :value="item.constValue"
  49. ></el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item prop="contractNo" label="合同编号/移库任务编号" span="1">
  53. <el-select
  54. v-model="deptBudgetList.contractNo"
  55. placeholder="请选择编号"
  56. >
  57. <el-option
  58. v-for="item in contractNoList"
  59. :key="item.constKey"
  60. :label="item.contractNo"
  61. :value="item.contractNo"
  62. ></el-option>
  63. </el-select>
  64. </el-form-item>
  65. <el-form-item prop="goodsName" label="货名" span="1">
  66. <el-select
  67. v-model="deptBudgetList.goodsName"
  68. placeholder="请输入货名"
  69. @change="selectgoodsname"
  70. >
  71. <el-option
  72. v-for="item in goodnameList"
  73. :key="item.constKey"
  74. :label="item.constValue"
  75. :value="item.constValue"
  76. ></el-option>
  77. </el-select>
  78. </el-form-item>
  79. <el-form-item label="重量(吨)" span="1" prop="weight">
  80. <el-input
  81. @input="weightchange"
  82. v-model="deptBudgetList.weight"
  83. placeholder="请输入重量"
  84. maxlength="20"
  85. size="small"
  86. ></el-input>
  87. </el-form-item>
  88. </ws-info-table>
  89. <ws-info-table class="el-table">
  90. <div class="start-address" style="width: 36%">
  91. <el-radio-group
  92. @change="warehouseTypechange"
  93. v-model="deptBudgetList.warehouseType"
  94. >
  95. <el-radio label="1">常用仓库发货</el-radio>
  96. <el-radio label="2">临时仓库发货</el-radio>
  97. </el-radio-group>
  98. <el-select
  99. v-model="deptBudgetList.sendWarehouse"
  100. placeholder="选择仓库"
  101. class="typeselect"
  102. @change="sendWarehousechange"
  103. >
  104. <el-option
  105. v-for="item in warehouseList"
  106. :key="item.constKey"
  107. :label="item.warehouseName"
  108. :value="item.warehouseName"
  109. ></el-option>
  110. </el-select>
  111. </div>
  112. <el-form-item label="始发地" span="1" class="start-address">
  113. <el-cascader
  114. :options="options_"
  115. v-model="selectedOptions"
  116. clearable
  117. size="large"
  118. placeholder="请选择始发地"
  119. @change="handleChange"
  120. />
  121. </el-form-item>
  122. <el-form-item
  123. label="始发地详细地址"
  124. span="1"
  125. prop="startDetailedAddress"
  126. class="bg-right start-address"
  127. >
  128. <el-input
  129. v-model="deptBudgetList.startDetailedAddress"
  130. placeholder="请输入始发地详细地址"
  131. maxlength="20"
  132. size="small"
  133. ></el-input>
  134. </el-form-item>
  135. <el-form-item
  136. label="收货库点"
  137. span="1"
  138. prop="contractNo"
  139. class="start-address"
  140. style="width: 36%"
  141. >
  142. <el-select
  143. v-model="deptBudgetList.receiveWarehouse"
  144. :disabled="warehouse"
  145. placeholder="请输入收货库点"
  146. style="width: 100%"
  147. >
  148. <el-option
  149. v-for="item in warehouseList"
  150. :key="item.constKey"
  151. :label="item.warehouseName"
  152. :value="item.warehouseName"
  153. ></el-option>
  154. </el-select>
  155. </el-form-item>
  156. <el-form-item
  157. label="终到地"
  158. span="1"
  159. prop="contractNo"
  160. class="start-address"
  161. >
  162. <el-cascader
  163. :options="options_"
  164. v-model="selectedOptions1"
  165. clearable
  166. size="large"
  167. placeholder="请选择终到地"
  168. @change="handleChange1"
  169. />
  170. </el-form-item>
  171. <el-form-item
  172. label="终到地详细地址"
  173. span="1"
  174. prop="endDetailedAddress"
  175. class="bg-right start-address"
  176. >
  177. <el-input
  178. v-model="deptBudgetList.endDetailedAddress"
  179. placeholder="请输入终到地详细地址"
  180. maxlength="20"
  181. size="small"
  182. ></el-input>
  183. </el-form-item>
  184. <div class="check-box">
  185. <span class="check-box">运输方式</span>
  186. <el-checkbox-group v-model="checkList" prop="tranType">
  187. <el-checkbox label="汽运" checked></el-checkbox>
  188. <el-checkbox label="火运"></el-checkbox>
  189. <el-checkbox label="船运"></el-checkbox>
  190. </el-checkbox-group>
  191. </div>
  192. </ws-info-table>
  193. <div
  194. style="width: 100%"
  195. class="position"
  196. v-for="(item, index) in deptBudgetList.tranProcessInfoList"
  197. :key="index"
  198. >
  199. <div class="driver">
  200. <span style="vertical-align: top"
  201. >运输阶段{{ index + 1 }} {{ item.processNo }}</span
  202. >
  203. <img
  204. v-if="!endflag"
  205. width="22"
  206. height="22"
  207. class="add"
  208. @click="add(index)"
  209. src="../../../public/img/add.png"
  210. alt=""
  211. />
  212. <img
  213. width="22"
  214. height="22"
  215. class="del"
  216. @click="del(index)"
  217. src="../../../public/img/del.png"
  218. alt=""
  219. />
  220. <el-checkbox
  221. @change="engflagchange"
  222. class="endflag"
  223. v-if="index == deptBudgetList.tranProcessInfoList.length - 1"
  224. v-model="item.endFlag"
  225. :label="1"
  226. >最终阶段</el-checkbox
  227. >
  228. </div>
  229. <ws-info-table>
  230. <el-form-item label="运输方式" span="1" prop="waterContent">
  231. <el-select
  232. v-model="item.tranType"
  233. placeholder="运输方式"
  234. @change="
  235. (val) => {
  236. selecttaskwayList(val, index)
  237. }
  238. "
  239. >
  240. <el-option
  241. v-for="item in taskwayList"
  242. :key="item.constKey"
  243. :label="item.constValue"
  244. :value="item.constValue"
  245. ></el-option>
  246. </el-select>
  247. </el-form-item>
  248. <el-form-item label="发货日期" span="1" prop="impurity">
  249. <ws-date-picker
  250. v-model="item.deliveryDateStart"
  251. type="date"
  252. placeholder="请选择发货日期"
  253. value-format="yyyy-MM-dd"
  254. />
  255. </el-form-item>
  256. <el-form-item label="最晚到货日期" span="1" prop="bulkDensity">
  257. <ws-date-picker
  258. v-model="item.deliveryDateEnd"
  259. type="date"
  260. placeholder="请选择最晚到货日期"
  261. value-format="yyyy-MM-dd"
  262. />
  263. </el-form-item>
  264. <el-form-item
  265. label="本阶段运输重量(吨)"
  266. span="1"
  267. prop="bulkDensity"
  268. >
  269. <el-input
  270. v-model="item.weight"
  271. placeholder="请输入本阶段运输重量"
  272. size="small"
  273. ></el-input>
  274. </el-form-item>
  275. </ws-info-table>
  276. <ws-info-table>
  277. <el-form-item label="发货地区" span="1" prop="waterContent">
  278. <el-cascader
  279. :options="options_"
  280. v-model="item.selectedOptions"
  281. clearable
  282. size="large"
  283. placeholder="请选择发货地区"
  284. style="width: 200%"
  285. @change="
  286. (val) => {
  287. handleChange3(val, index)
  288. }
  289. "
  290. />
  291. </el-form-item>
  292. <el-form-item label="发货地详细地址" span="1" prop="impurity">
  293. <el-input
  294. v-model="item.sendDetailedAddress"
  295. placeholder="请输入发货地详细地址"
  296. maxlength="20"
  297. size="small"
  298. ></el-input>
  299. </el-form-item>
  300. <el-form-item label="发货人" span="1" prop="bulkDensity">
  301. <el-input
  302. v-model="item.sender"
  303. placeholder="请输入发货人"
  304. maxlength="20"
  305. size="small"
  306. ></el-input>
  307. </el-form-item>
  308. <el-form-item label="发货人电话" span="1" prop="bulkDensity">
  309. <el-input
  310. v-model="item.senderPhone"
  311. placeholder="请输入发货人电话"
  312. maxlength="20"
  313. size="small"
  314. ></el-input>
  315. </el-form-item>
  316. </ws-info-table>
  317. <ws-info-table>
  318. <el-form-item label="收货地区" span="1" prop="bulkDensity">
  319. <el-cascader
  320. :options="options_"
  321. v-model="item.selectedOptions1"
  322. clearable
  323. size="large"
  324. placeholder="请选择收货地区"
  325. style="width: 200%"
  326. @change="
  327. (val) => {
  328. handleChange4(val, index)
  329. }
  330. "
  331. />
  332. </el-form-item>
  333. <el-form-item label="收货地详细地址" span="1" prop="impurity">
  334. <el-input
  335. v-model="item.receiveDetailedAddress"
  336. placeholder="请输入收货地详细地址"
  337. maxlength="20"
  338. size="small"
  339. ></el-input>
  340. </el-form-item>
  341. <el-form-item label="收货人" span="1" prop="bulkDensity">
  342. <el-input
  343. v-model="item.receiver"
  344. placeholder="请输入收货人"
  345. maxlength="20"
  346. size="small"
  347. ></el-input>
  348. </el-form-item>
  349. <el-form-item label="收货人电话" span="1" prop="bulkDensity">
  350. <el-input
  351. v-model="item.receiverPhone"
  352. placeholder="请输入收货人电话"
  353. maxlength="20"
  354. size="small"
  355. ></el-input>
  356. </el-form-item>
  357. </ws-info-table>
  358. </div>
  359. </el-form>
  360. <!-- 提交 -->
  361. <div style="text-align: right; padding: 10px" class="center">
  362. <el-button
  363. class="bg-bottom"
  364. type="primary"
  365. size="small"
  366. @click="submit(deptBudgetList)"
  367. >提交</el-button
  368. >
  369. </div>
  370. </div>
  371. </template>
  372. <script>
  373. import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
  374. import { packList } from '@/model/contarct/index'
  375. import {
  376. edittran,
  377. getwarehousename,
  378. xialaNo,
  379. examinetran,
  380. } from '@/model/tasksport/index'
  381. import WsUpload from '@/components/WsUpload'
  382. import mapDrag from '@/components/mapdrag/mapdrag'
  383. export default {
  384. name: 'viewSpareMoney',
  385. components: {
  386. WsUpload,
  387. mapDrag,
  388. },
  389. watch: {
  390. vesselId(val) {
  391. this.getVesselData()
  392. },
  393. isShow(val) {
  394. this.showType = val
  395. },
  396. },
  397. data() {
  398. let self = this
  399. return {
  400. checkList: [],
  401. deptBudgetList: {},
  402. radio: '1',
  403. endflag: false,
  404. carModelList: [],
  405. carLengthList: [],
  406. warehouseType: '1',
  407. options_: regionData,
  408. heightData: '600px',
  409. selectedOptions: [],
  410. selectedOptions1: [],
  411. compId: sessionStorage.getItem('ws-pf_compId'),
  412. mainReportAdd: {},
  413. warehouseList: [],
  414. goodnameList: [],
  415. taskType: [],
  416. size: 10,
  417. unitList: [],
  418. contractNoList: [],
  419. taskwayList: [],
  420. name: '',
  421. age: '',
  422. weight: 0,
  423. number:2,
  424. }
  425. },
  426. activated() {
  427. this.loaddata()
  428. this.showType = this.isShow
  429. },
  430. computed: {
  431. warehouse: function () {
  432. if (
  433. this.deptBudgetList.taskType == '销售出库' ||
  434. this.deptBudgetList.taskType == '贸易服务出库' ||
  435. this.deptBudgetList.taskType == '暂存出库'
  436. ) {
  437. return true
  438. } else {
  439. return false
  440. }
  441. },
  442. },
  443. methods: {
  444. sendWarehousechange(e) {
  445. for (let i = 0; i < this.warehouseList.length; i++) {
  446. if (this.warehouseList[i].warehouseName == e) {
  447. var tmp = []
  448. tmp[0] = TextToCode[this.warehouseList[i].warehousePrivate].code
  449. tmp[1] =
  450. TextToCode[this.warehouseList[i].warehousePrivate][
  451. this.warehouseList[i].warehouseCity
  452. ].code
  453. tmp[2] =
  454. TextToCode[this.warehouseList[i].warehousePrivate][
  455. this.warehouseList[i].warehouseCity
  456. ][this.warehouseList[i].warehouseArea].code
  457. this.selectedOptions = tmp
  458. this.deptBudgetList.tranProcessInfoList[0].selectedOptions = tmp
  459. // this.deptBudgetList.startDetailedAddress =
  460. // this.warehouseList[i].detailedAddress
  461. // this.deptBudgetList.tranProcessInfoList[0].sendDetailedAddress =
  462. // this.warehouseList[i].detailedAddress
  463. this.$set(this.deptBudgetList,'startDetailedAddress',this.warehouseList[i].detailedAddress)
  464. this.$set(this.deptBudgetList.tranProcessInfoList[0],'sendDetailedAddress',this.deptBudgetList.startDetailedAddress)
  465. }
  466. }
  467. },
  468. warehouseTypechange() {
  469. getwarehousename({
  470. compId: this.compId,
  471. warehouseType: this.deptBudgetList.warehouseType,
  472. })
  473. .toPromise()
  474. .then((response) => {
  475. this.warehouseList = response
  476. })
  477. },
  478. weightchange(e) {
  479. this.deptBudgetList.tranProcessInfoList[0].weight = e
  480. },
  481. engflagchange(e) {
  482. this.endflag = e
  483. if (this.endflag) {
  484. this.deptBudgetList.tranProcessInfoList[
  485. this.deptBudgetList.tranProcessInfoList.length - 1
  486. ].selectedOptions1 = this.selectedOptions1
  487. this.deptBudgetList.tranProcessInfoList[
  488. this.deptBudgetList.tranProcessInfoList.length - 1
  489. ].receiveDetailedAddress = this.deptBudgetList.endDetailedAddress
  490. } else {
  491. this.deptBudgetList.tranProcessInfoList[
  492. this.deptBudgetList.tranProcessInfoList.length - 1
  493. ].selectedOptions1 = []
  494. this.deptBudgetList.tranProcessInfoList[
  495. this.deptBudgetList.tranProcessInfoList.length - 1
  496. ].receiveDetailedAddress = ''
  497. }
  498. },
  499. loaddata() {
  500. examinetran({ id: this.$route.query.id })
  501. .toPromise()
  502. .then((response) => {
  503. this.deptBudgetList = response
  504. this.number = response.tranProcessInfoList.length+1
  505. if (
  506. response.startPrivate != null &&
  507. response.startCity != null &&
  508. response.startArea != null
  509. ) {
  510. var tmp = []
  511. tmp[0] = TextToCode[response.startPrivate].code
  512. tmp[1] = TextToCode[response.startPrivate][response.startCity].code
  513. tmp[2] =
  514. TextToCode[response.startPrivate][response.startCity][
  515. response.startArea
  516. ].code
  517. this.selectedOptions = tmp
  518. }
  519. if (
  520. response.endPrivate != null &&
  521. response.endCity != null &&
  522. response.endArea != null
  523. ) {
  524. var tmp1 = []
  525. tmp1[0] = TextToCode[response.endPrivate].code
  526. tmp1[1] = TextToCode[response.endPrivate][response.endCity].code
  527. tmp1[2] =
  528. TextToCode[response.endPrivate][response.endCity][
  529. response.endArea
  530. ].code
  531. this.selectedOptions1 = tmp1
  532. }
  533. for (var i = 0; i < response.tranProcessInfoList.length; i++) {
  534. if (
  535. response.tranProcessInfoList[i].sendPrivate != '' &&
  536. response.tranProcessInfoList[i].sendCity != '' &&
  537. response.tranProcessInfoList[i].sendArea != ''
  538. ) {
  539. var tmp2 = []
  540. tmp2[0] =
  541. TextToCode[response.tranProcessInfoList[i].sendPrivate].code
  542. tmp2[1] =
  543. TextToCode[response.tranProcessInfoList[i].sendPrivate][
  544. response.tranProcessInfoList[i].sendCity
  545. ].code
  546. tmp2[2] =
  547. TextToCode[response.tranProcessInfoList[i].sendPrivate][
  548. response.tranProcessInfoList[i].sendCity
  549. ][response.tranProcessInfoList[i].sendArea].code
  550. response.tranProcessInfoList[i].selectedOptions = tmp2
  551. }
  552. if (
  553. response.tranProcessInfoList[i].receivePrivate != '' &&
  554. response.tranProcessInfoList[i].receiveCity != '' &&
  555. response.tranProcessInfoList[i].receiveArea != ''
  556. ) {
  557. var tmp3 = []
  558. tmp3[0] =
  559. TextToCode[response.tranProcessInfoList[i].receivePrivate].code
  560. tmp3[1] =
  561. TextToCode[response.tranProcessInfoList[i].receivePrivate][
  562. response.tranProcessInfoList[i].receiveCity
  563. ].code
  564. tmp3[2] =
  565. TextToCode[response.tranProcessInfoList[i].receivePrivate][
  566. response.tranProcessInfoList[i].receiveCity
  567. ][response.tranProcessInfoList[i].receiveArea].code
  568. response.tranProcessInfoList[i].selectedOptions1 = tmp3
  569. }
  570. this.weight = response.weight
  571. }
  572. this.checkList = response.tranType.split(',')
  573. })
  574. // 货名
  575. packList({ constId: 'CON2' })
  576. .toPromise()
  577. .then((response) => {
  578. this.goodnameList = response
  579. })
  580. // 任务类型
  581. packList({ constId: 'TRAN3' })
  582. .toPromise()
  583. .then((response) => {
  584. this.taskType = response
  585. })
  586. // 运输方式
  587. packList({ constId: 'TRAN6' })
  588. .toPromise()
  589. .then((response) => {
  590. this.taskwayList = response
  591. })
  592. getwarehousename({
  593. compId: this.compId,
  594. warehouseType: this.deptBudgetList.warehouseType,
  595. })
  596. .toPromise()
  597. .then((response) => {
  598. this.warehouseList = response
  599. })
  600. xialaNo({
  601. compId: this.compId,
  602. })
  603. .toPromise()
  604. .then((response) => {
  605. this.contractNoList = response
  606. })
  607. },
  608. selecttaskType(e) {
  609. for (var i = 0; i < this.taskType.length; i++) {
  610. if (this.taskType[i].constValue == e) {
  611. this.deptBudgetList.taskTypeKey = this.taskType[i].constKey
  612. }
  613. }
  614. },
  615. selecttaskwayList(e, index) {
  616. for (var i = 0; i < this.taskwayList.length; i++) {
  617. if (this.taskwayList[i].constValue == e) {
  618. this.deptBudgetList.tranProcessInfoList[index].tranTypeKey =
  619. this.taskwayList[i].constKey
  620. }
  621. }
  622. },
  623. selectgoodsname(e) {
  624. for (var i = 0; i < this.goodnameList.length; i++) {
  625. if (this.goodnameList[i].constValue == e) {
  626. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  627. }
  628. }
  629. },
  630. // 关闭 dialog时 处理文件url 初始化upload组件
  631. handleClose() {
  632. this.dialogViewSpareMoney = false
  633. },
  634. add(index) {
  635. this.deptBudgetList.tranProcessInfoList.push({
  636. processNo: this.deptBudgetList.taskNo+(this.number),
  637. sort:0,
  638. tranType: '汽运',
  639. tranTypeKey: '1',
  640. deliveryDateStart: '',
  641. deliveryDateEnd: '',
  642. weight: this.weight,
  643. selectedOptions: [],
  644. selectedOptions1: [],
  645. sendPrivate: '',
  646. sendCity: '',
  647. sendArea: '',
  648. receivePrivate: '',
  649. receiveCity: '',
  650. receiveArea: '',
  651. sendDetailedAddress: '',
  652. receiveDetailedAddress: '',
  653. sender: '',
  654. receiver: '',
  655. senderPhone: '',
  656. receiverPhone: '',
  657. })
  658. this.number++
  659. },
  660. del(index) {
  661. if (this.deptBudgetList.tranProcessInfoList.length > 1) {
  662. this.deptBudgetList.tranProcessInfoList.splice(index, 1)
  663. }
  664. this.number--
  665. },
  666. handleChange(value) {
  667. this.selectedOptions = value
  668. this.deptBudgetList.startPrivate = CodeToText[value[0]]
  669. this.deptBudgetList.startCity = CodeToText[value[1]]
  670. this.deptBudgetList.startArea = CodeToText[value[2]]
  671. },
  672. handleChange1(value) {
  673. this.selectedOptions1 = value
  674. this.deptBudgetList.endPrivate = CodeToText[value[0]]
  675. this.deptBudgetList.endCity = CodeToText[value[1]]
  676. this.deptBudgetList.endArea = CodeToText[value[2]]
  677. },
  678. handleChange3(value, index) {
  679. this.deptBudgetList.tranProcessInfoList[index].sendPrivate =
  680. CodeToText[value[0]]
  681. this.deptBudgetList.tranProcessInfoList[index].sendCity =
  682. CodeToText[value[1]]
  683. this.deptBudgetList.tranProcessInfoList[index].sendArea =
  684. CodeToText[value[2]]
  685. },
  686. handleChange4(value, index) {
  687. this.deptBudgetList.tranProcessInfoList[index].receivePrivate =
  688. CodeToText[value[0]]
  689. this.deptBudgetList.tranProcessInfoList[index].receiveCity =
  690. CodeToText[value[1]]
  691. this.deptBudgetList.tranProcessInfoList[index].receiveArea =
  692. CodeToText[value[2]]
  693. },
  694. returnsales() {
  695. this.$router.push({ path: 'tranManagementTransport' })
  696. },
  697. submit() {
  698. this.$refs.deptBudgetList.validate((valid) => {
  699. if (valid) {
  700. if (!this.deptBudgetList.taskNo) {
  701. this.$message({
  702. message: '任务编号不能为空!',
  703. type: 'warning',
  704. })
  705. return
  706. }
  707. if (!this.deptBudgetList.taskType) {
  708. this.$message({
  709. message: '任务类型不能为空!',
  710. type: 'warning',
  711. })
  712. return
  713. }
  714. if (!this.deptBudgetList.contractNo) {
  715. this.$message({
  716. message: '合同编号/移库任务编号不能为空!',
  717. type: 'warning',
  718. })
  719. return
  720. }
  721. if (!this.deptBudgetList.goodsName) {
  722. this.$message({
  723. message: '货名不能为空!',
  724. type: 'warning',
  725. })
  726. return
  727. }
  728. if (!this.deptBudgetList.weight) {
  729. this.$message({
  730. message: '重量(吨)不能为空!',
  731. type: 'warning',
  732. })
  733. return
  734. }
  735. if (!this.deptBudgetList.sendWarehouse) {
  736. this.$message({
  737. message: '发货仓库不能为空!',
  738. type: 'warning',
  739. })
  740. return
  741. }
  742. if (this.selectedOptions.length <= 0) {
  743. this.$message({
  744. message: '始发地不能为空!',
  745. type: 'warning',
  746. })
  747. return
  748. }
  749. if (!this.deptBudgetList.startDetailedAddress) {
  750. this.$message({
  751. message: '始发地详细地址不能为空!',
  752. type: 'warning',
  753. })
  754. return
  755. }
  756. if (this.selectedOptions1.length <= 0) {
  757. this.$message({
  758. message: '终到地不能为空!',
  759. type: 'warning',
  760. })
  761. return
  762. }
  763. if (!this.deptBudgetList.endDetailedAddress) {
  764. this.$message({
  765. message: '终到地详细地址不能为空!',
  766. type: 'warning',
  767. })
  768. return
  769. }
  770. if (this.checkList.length <= 0) {
  771. this.$message({
  772. message: '运输方式多选框不能为空!',
  773. type: 'warning',
  774. })
  775. return
  776. }
  777. for (
  778. var i = 0;
  779. i < this.deptBudgetList.tranProcessInfoList.length;
  780. i++
  781. ) {
  782. this.deptBudgetList.tranProcessInfoList[i].processNo =
  783. this.deptBudgetList.taskNo + (i + 1)
  784. if (
  785. new Date(
  786. this.deptBudgetList.tranProcessInfoList[i].deliveryDateStart
  787. ).getTime() >
  788. new Date(
  789. this.deptBudgetList.tranProcessInfoList[i].deliveryDateEnd
  790. ).getTime()
  791. ) {
  792. this.$message({
  793. message: '发货日期不能大于最晚到货日期!',
  794. type: 'warning',
  795. })
  796. return
  797. }
  798. if (!this.deptBudgetList.tranProcessInfoList[i].deliveryDateStart) {
  799. this.$message({
  800. message: '发货日期不能为空!',
  801. type: 'warning',
  802. })
  803. return
  804. }
  805. if (!this.deptBudgetList.tranProcessInfoList[i].deliveryDateEnd) {
  806. this.$message({
  807. message: '最晚到货日期不能为空!',
  808. type: 'warning',
  809. })
  810. return
  811. }
  812. if (!this.deptBudgetList.tranProcessInfoList[i].weight) {
  813. this.$message({
  814. message: '重量不能为空!',
  815. type: 'warning',
  816. })
  817. return
  818. }
  819. if (!this.deptBudgetList.tranProcessInfoList[i].sender) {
  820. this.$message({
  821. message: '发货人不能为空!',
  822. type: 'warning',
  823. })
  824. return
  825. }
  826. if (!this.deptBudgetList.tranProcessInfoList[i].senderPhone) {
  827. this.$message({
  828. message: '发货人电话不能为空!',
  829. type: 'warning',
  830. })
  831. return
  832. }
  833. if (!this.deptBudgetList.tranProcessInfoList[i].receiver) {
  834. this.$message({
  835. message: '收货人不能为空!',
  836. type: 'warning',
  837. })
  838. return
  839. }
  840. if (!this.deptBudgetList.tranProcessInfoList[i].receiverPhone) {
  841. this.$message({
  842. message: '收货人电话不能为空!',
  843. type: 'warning',
  844. })
  845. return
  846. }
  847. if (
  848. !this.deptBudgetList.tranProcessInfoList[i].receiveDetailedAddress
  849. ) {
  850. this.$message({
  851. message: '收获详细地址不能为空!',
  852. type: 'warning',
  853. })
  854. return
  855. }
  856. if (
  857. !this.deptBudgetList.tranProcessInfoList[i].sendDetailedAddress
  858. ) {
  859. this.$message({
  860. message: '发货详细地址不能为空!',
  861. type: 'warning',
  862. })
  863. return
  864. }
  865. }
  866. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  867. this.deptBudgetList.tranType = this.checkList.toString()
  868. this.deptBudgetList.startPrivate = CodeToText[this.selectedOptions[0]]
  869. this.deptBudgetList.startCity = CodeToText[this.selectedOptions[1]]
  870. this.deptBudgetList.startArea = CodeToText[this.selectedOptions[2]]
  871. this.deptBudgetList.tranProcessInfoList[0].sendPrivate = CodeToText[this.selectedOptions[0]]
  872. this.deptBudgetList.tranProcessInfoList[0].sendCity = CodeToText[this.selectedOptions[1]]
  873. this.deptBudgetList.tranProcessInfoList[0].sendArea = CodeToText[this.selectedOptions[2]]
  874. for(var i = 0; i< this.deptBudgetList.tranProcessInfoList.length ; i++){
  875. this.deptBudgetList.tranProcessInfoList[i].sort = i
  876. // this.deptBudgetList.tranProcessInfoList[i].sendPrivate = CodeToText[this.selectedOptions[0]]
  877. // this.deptBudgetList.tranProcessInfoList[i].sendCity = CodeToText[this.selectedOptions[1]]
  878. // this.deptBudgetList.tranProcessInfoList[i].sendArea = CodeToText[this.selectedOptions[2]]
  879. // this.deptBudgetList.tranProcessInfoList[i].receivePrivate = CodeToText[this.selectedOptions1[0]]
  880. // this.deptBudgetList.tranProcessInfoList[i].receiveCity = CodeToText[this.selectedOptions1[1]]
  881. // this.deptBudgetList.tranProcessInfoList[i].receiveArea = CodeToText[this.selectedOptions1[2]]
  882. // console.log(CodeToText[this.selectedOptions1[0]],"省")
  883. // console.log(CodeToText[this.selectedOptions1[1]],"市")
  884. // console.log(CodeToText[this.selectedOptions1[2]],"区")
  885. }
  886. edittran(this.deptBudgetList)
  887. .toPromise()
  888. .then((response) => {
  889. this.$message.success('编辑成功')
  890. this.deptBudgetList = {}
  891. this.$router.push({ path: 'tranManagementTransport' })
  892. })
  893. } else {
  894. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  895. return false
  896. }
  897. })
  898. },
  899. resetForm(deptBudgetList) {
  900. this.$refs[deptBudgetList].resetFields()
  901. },
  902. },
  903. }
  904. </script>
  905. <style lang="scss" scoped>
  906. .position {
  907. position: relative;
  908. border-radius: 5px;
  909. border: 1px solid #5473e8;
  910. margin-top: 20px;
  911. background: #f6f7fc;
  912. border-left: 5px solid #5473e8;
  913. }
  914. .position .ws-info-table .el-form-item {
  915. width: 25%;
  916. }
  917. .typeselect {
  918. width: 42%;
  919. margin-left: 32px;
  920. }
  921. /deep/.position .ws-info-table .el-form-item .el-form-item__label,
  922. /deep/.position .ws-info-table .el-form-item .el-form-item__content {
  923. background: #f6f7fc;
  924. }
  925. /deep/.position .el-select {
  926. width: 100%;
  927. }
  928. .del,
  929. .add {
  930. cursor: pointer;
  931. margin-left: 10px;
  932. }
  933. .el-checkbox-group {
  934. font-size: 0;
  935. float: right;
  936. margin-left: 24px;
  937. color: #8890b1;
  938. }
  939. /deep/.el-checkbox__label {
  940. color: #8890b1;
  941. }
  942. .el-form-item.start-address.el-form-item--small {
  943. width: 31.9%;
  944. }
  945. .check-box {
  946. margin-top: 10px;
  947. margin-left: 16px;
  948. color: #8890b1;
  949. font-size: 14px;
  950. }
  951. /deep/.el-table--border:after,
  952. /deep/.el-table--group:after,
  953. /deep/.el-table:before {
  954. background: transparent;
  955. }
  956. .el-form {
  957. padding: 0 10%;
  958. }
  959. .ws-info-table {
  960. border: none;
  961. }
  962. /deep/.ws-info-table .el-form-item {
  963. border: none;
  964. height: 50px;
  965. }
  966. .readonly {
  967. position: relative;
  968. }
  969. .title {
  970. position: relative;
  971. }
  972. .title::before {
  973. content: '';
  974. display: inline-block;
  975. width: 5px;
  976. height: 30px;
  977. background: #5473e8;
  978. position: absolute;
  979. left: 0;
  980. }
  981. //去边框
  982. /deep/.el-form-item {
  983. border-right: 0px;
  984. border-bottom: 0px;
  985. }
  986. .el-form {
  987. margin-top: 50px;
  988. }
  989. .el-col {
  990. background: #f6f7fc;
  991. }
  992. .bg-left {
  993. padding-left: 30px;
  994. }
  995. .bg-right {
  996. padding-right: 10px;
  997. text-align: right;
  998. }
  999. .bg-bottom {
  1000. margin: 15px 0px;
  1001. background: #5473e8;
  1002. }
  1003. .el-radio,
  1004. .el-radio__input {
  1005. margin-top: 11px;
  1006. margin-left: 11px;
  1007. width: 93px;
  1008. }
  1009. /deep/.ws-info-table .el-form-item {
  1010. width: 20%;
  1011. }
  1012. /deep/.nei {
  1013. .ws-info-table {
  1014. border: none;
  1015. }
  1016. .el-form-item {
  1017. width: 33.3333%;
  1018. border: none;
  1019. .el-form-item__label {
  1020. background: transparent;
  1021. border: none;
  1022. }
  1023. .el-form-item__content {
  1024. border: none;
  1025. }
  1026. }
  1027. }
  1028. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1029. background: #fff;
  1030. text-align: center;
  1031. color: #8890b1;
  1032. font-size: 14px;
  1033. }
  1034. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1035. border: none;
  1036. }
  1037. .start-address {
  1038. width: 33.333%;
  1039. }
  1040. /deep/.start-address .ws-info-table .el-form-item .el-form-item__content {
  1041. width: 100%;
  1042. color: #8890b1;
  1043. font-size: 14px;
  1044. }
  1045. .driver {
  1046. height: 30px;
  1047. margin-left: 20px;
  1048. margin-top: 10px;
  1049. line-height: 30px;
  1050. font-size: 16px;
  1051. color: #5473e8;
  1052. }
  1053. .el-form {
  1054. height: 73vh;
  1055. overflow: scroll;
  1056. }
  1057. .el-cascader {
  1058. width: 100%;
  1059. }
  1060. </style>