tranManagementTransportEdit.vue 38 KB

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