tranManagementVehicleDispatching.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262
  1. // 汽车调度派车
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="20">
  6. <h2 class="bg-left title">汽车调度</h2>
  7. </el-col>
  8. <el-col :span="4" class="bg-right">
  9. <el-button class="bg-bottom" type="primary" size="small" @click="revert()"><img width="6" height="10"
  10. style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
  11. </el-button>
  12. </el-col>
  13. </el-row>
  14. <div class="center">
  15. <el-form ref="deptBudgetList" :model="deptBudgetList" label-width="110px">
  16. <div class="basicInformation">
  17. <div class="small-title" style="font-size: 16px">任务详情</div>
  18. <el-row>
  19. <el-col :span="8">
  20. <el-form-item label="任务编号" span="1" prop="processNo">
  21. <el-input type="text" class="row-item" v-model="deptBudgetList.processNo" disabled></el-input>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :span="8">
  25. <el-form-item label="货名" span="1">
  26. <el-input type="text" class="row-item" v-model="deptBudgetList.goodsName" disabled></el-input>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="8">
  30. <el-form-item label="重量(吨)" span="1" prop="tare" class="readonly">
  31. <el-input type="text" class="row-item" v-model="deptBudgetList.weight" disabled></el-input>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="8">
  35. <el-form-item label="发货地址" span="1" prop="netWeight">
  36. <el-input type="text" class="row-item" v-model="fhaddress" disabled></el-input>
  37. <!-- {{ deptBudgetList.sendPrivate }}{{ deptBudgetList.sendCity
  38. }}{{ deptBudgetList.sendArea
  39. }}{{ deptBudgetList.sendDetailedAddress }} -->
  40. </el-form-item>
  41. </el-col>
  42. <el-col :span="8">
  43. <el-form-item label="发货人" span="1" prop="agent">
  44. <el-input type="text" class="row-item" v-model="deptBudgetList.sender" disabled></el-input>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="8">
  48. <el-form-item label="发货人电话" span="1" prop="agent">
  49. <el-input type="text" class="row-item" v-model="deptBudgetList.senderPhone" disabled></el-input>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="8">
  53. <el-form-item label="收货地址" span="1" prop="netWeight">
  54. <el-input type="text" class="row-item" v-model="shaddress" disabled></el-input>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="8">
  58. <el-form-item label="收货人电话" span="1" prop="receiverPhone">
  59. <el-input type="text" class="row-item" v-model="deptBudgetList.receiverPhone" disabled></el-input>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="8">
  63. <el-form-item label="发货日期" span="1" prop="inOutDate" class="deliverydate">
  64. <el-input type="text" class="row-item" v-model="deptBudgetList.deliveryDateStart" disabled></el-input>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :span="8">
  68. <el-form-item label="最晚到货日期" span="1" prop="inOutDate" class="deliverydate">
  69. <el-input type="text" class="row-item" v-model="deptBudgetList.deliveryDateEnd" disabled></el-input>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="8">
  73. <el-form-item v-if="deptBudgetList.taskType=='移库'" label="移库编号" span="1" prop="contractNo">
  74. <el-input type="text" class="row-item" v-model="deptBudgetList.contractNo" disabled></el-input>
  75. </el-form-item>
  76. <el-form-item v-else label="合同编号" span="1" prop="contractNo">
  77. <el-input type="text" class="row-item" v-model="deptBudgetList.contractNo" disabled></el-input>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="8">
  81. <el-form-item label="关联合同" v-if="deptBudgetList.relatedContract" span="1" prop="inOutDate"
  82. class="relatedContract">
  83. <el-input type="text" class="row-item" v-model="deptBudgetList.relatedContract" disabled></el-input>
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <div class="small-title" style="font-size: 16px">派车
  88. <el-radio-group @change='pricetypechange' v-model="pricetype">
  89. <el-radio label="1">元/吨计费</el-radio>
  90. <el-radio label="2">元/车计费</el-radio>
  91. </el-radio-group>
  92. </div>
  93. <div class="myTest">
  94. <el-form-item v-if='pricetype==1' label="当前运输单价(元/吨):" prop="tranPrice" label-width="150px" class="input-item-margin">
  95. <el-input v-model="deptBudgetList.tranPrice" maxlength="70" disabled />
  96. </el-form-item>
  97. <el-form-item v-else label="当前运输单价(元/车):" prop="tranPrice" label-width="150px" class="input-item-margin">
  98. <el-input v-model="deptBudgetList.tranPriceCar" maxlength="70" disabled />
  99. </el-form-item>
  100. <el-form-item v-if='pricetype==1' label="审核中的运输总价(元/吨):" prop="tranPriceIng" label-width="180px" class="input-item-margin">
  101. <el-input v-if="deptBudgetList.priceStatus=='审核中'" :disabled="readonly"
  102. v-model="deptBudgetList.tranPriceIng" maxlength="70" />
  103. <el-input v-else v-model="deptBudgetList.tranPriceIng" maxlength="70" />
  104. </el-form-item>
  105. <el-form-item v-else label="审核中的运输总价(元/车):" prop="tranPriceIng" label-width="180px" class="input-item-margin">
  106. <el-input v-if="deptBudgetList.priceStatusCar=='审核中'" :disabled="readonly"
  107. v-model="deptBudgetList.tranPriceIngCar" maxlength="70" />
  108. <el-input v-else v-model="deptBudgetList.tranPriceIngCar" maxlength="70" />
  109. </el-form-item>
  110. <div class="input-item-margin">
  111. <div v-if="deptBudgetList.priceStatus=='审核中'&&pricetype==1">
  112. <el-button type="primary" v-hasPermission="`tranManager.vehicleDispatching.reprice`" size="small"
  113. @click="examine(1)">审核中
  114. </el-button>
  115. </div>
  116. <el-button v-if="deptBudgetList.priceStatus!='审核中'&&pricetype==1" type="primary" @click="priceSubmit(1)">提交</el-button>
  117. <div v-if="deptBudgetList.priceStatusCar=='审核中'&&pricetype==2">
  118. <el-button type="primary" v-hasPermission="`tranManager.vehicleDispatching.reprice`" size="small"
  119. @click="examine(2)">审核中
  120. </el-button>
  121. </div>
  122. <el-button v-if="deptBudgetList.priceStatusCar!='审核中'&&pricetype==2" type="primary" @click="priceSubmit(2)">提交</el-button>
  123. </div>
  124. </div>
  125. <div class="content3" v-for="(item, index) in driverlist" :key="index">
  126. <div class="content3-item1">
  127. <div class="">
  128. <span style="margin-left: 30px;font-weight: 600;">司机-{{ index + 1 }}</span>
  129. <span class="noservice" v-show="item.status == '未装车'">{{
  130. item.status
  131. }}</span>
  132. <span class="service" v-show="item.status == '已装车'">{{
  133. item.status
  134. }}</span>
  135. <span class="serviced" v-show="item.status == '已送达'">{{
  136. item.status
  137. }}</span>
  138. </div>
  139. <el-col :span="8">
  140. <el-form-item label="姓名:" span="1" prop="driverName" label-width="125px">
  141. <el-select ref="driverSelect" v-show="!item.temporaryDriverFlag" @visible-change="clearBlur"
  142. v-model="item.driver" filterable clearable placeholder="请选择司机" class="row-item" @change="
  143. (val) => {
  144. carchange(val, index)
  145. }
  146. ">
  147. <el-option v-for="(items, index) in carList" :key="index" :label="items.driverName"
  148. :value="items.driverName" />
  149. </el-select>
  150. <span v-show="
  151. item.temporaryDriverFlag == 0 ||
  152. item.temporaryDriverFlag == 1
  153. ">{{ item.driver }}</span>
  154. </el-form-item>
  155. </el-col>
  156. <el-col :span="8">
  157. <el-form-item label="司机电话:" span="1" prop="impurity" label-width="125px">
  158. <el-select v-show="!item.temporaryDriverFlag" v-model="item.driverPhone" placeholder="请选择司机电话"
  159. filterable clearable class="row-item" @change="
  160. (val) => {
  161. phonechange(val, index)
  162. }
  163. ">
  164. <el-option v-for="(items, index) in carList" :key="index" :label="items.driverPhone"
  165. :value="items.driverPhone" />
  166. </el-select>
  167. <span v-show="
  168. item.temporaryDriverFlag == 0 ||
  169. item.temporaryDriverFlag == 1
  170. ">{{ item.driverPhone }}</span>
  171. </el-form-item>
  172. </el-col>
  173. <el-col :span="8">
  174. <el-form-item label="车牌号:" span="1" prop="carNo" label-width="125px">
  175. <el-input :disabled="readonly" v-model="item.carNo" placeholder="" maxlength="120" size="small" />
  176. </el-form-item>
  177. </el-col>
  178. <el-col :span="8">
  179. <el-form-item label="派车编号:" span="1" prop="carModel" label-width="125px">
  180. <el-input :disabled="readonly" v-model="item.tranCarNo" maxlength="120" size="small" />
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="8">
  184. <el-form-item label="箱号:" span="1" prop="carModel" label-width="125px">
  185. <el-input v-if="item.status == '已装车'||item.status == '已送达'" :disabled="readonly" v-model="item.caseNo"
  186. maxlength="120" size="small" />
  187. <el-input v-else v-model="item.caseNo" placeholder="请输入箱号" maxlength="120" size="small" />
  188. </el-form-item>
  189. </el-col>
  190. <el-col :span="8">
  191. <el-form-item label="封号:" span="1" prop="carModel" label-width="125px">
  192. <el-input v-if="item.status == '已装车'||item.status == '已送达'" v-model="item.titleNo" placeholder=""
  193. :disabled="readonly" maxlength="120" size="small" />
  194. <el-input v-model="item.titleNo" placeholder="请输入封号" v-else maxlength="120" size="small" />
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="8">
  198. <el-form-item label="车型:" span="1" prop="carModel" label-width="125px">
  199. <el-input :disabled="readonly" v-model="item.carModel" placeholder="" maxlength="120" size="small" />
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="8">
  203. <el-form-item label="车长:" span="1" prop="carLength" label-width="125px">
  204. <el-input :disabled="readonly" v-model="item.carLength" placeholder="" maxlength="120" size="small" />
  205. </el-form-item>
  206. </el-col>
  207. <el-col :span="8">
  208. <el-form-item label="载重(吨):" span="1" prop="loadWeight" label-width="125px">
  209. <el-input :disabled="readonly" v-model="item.loadWeight" placeholder="" maxlength="120"
  210. size="small" />
  211. </el-form-item>
  212. </el-col>
  213. <el-col :span="8">
  214. <el-form-item v-if='item.billingMethod==1' label="运输单价(元/吨):" span="1" prop="carModel" label-width="125px">
  215. <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
  216. </el-form-item>
  217. <el-form-item v-else label="运输单价(元/车):" span="1" prop="carModel" label-width="125px">
  218. <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
  219. </el-form-item>
  220. </el-col>
  221. <span v-if="item.status == '未装车'||item.temporaryDriverFlag!=0" width="22" height="22" class="del"
  222. @click="del(index, item,0)" src="../../../public/img/del.png" alt="">×</span>
  223. </div>
  224. </div>
  225. <div class="contentitem" v-for="(item, index) in teamlist" :key="'team'+index">
  226. <div class="content3-item1">
  227. <el-col :span="8">
  228. <!-- <span style="margin-left: 30px;font-weight: 600;">车队-{{ index + 1 }}</span> -->
  229. <el-form-item :label="'车队-'+(index + 1 )" span="1" prop="carModel" label-width="125px">
  230. <el-input :disabled="item.id?true:false" v-model="item.fleetName" size="small" />
  231. </el-form-item>
  232. </el-col>
  233. <el-col :span="8">
  234. <el-form-item v-if='item.billingMethod==1' label="运输单价(元/吨):" span="1" prop="carModel" label-width="125px">
  235. <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
  236. </el-form-item>
  237. <el-form-item v-else label="运输单价(元/车):" span="1" prop="carModel" label-width="125px">
  238. <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
  239. </el-form-item>
  240. </el-col>
  241. <span v-if="!item.id" width="22" height="22" class="del"
  242. @click="del(index, item,1)" src="../../../public/img/del.png" alt="">×</span>
  243. </div>
  244. </div>
  245. <div style="text-align: right; color: #8890b1; font-size: 16px">
  246. 共{{ total }}/{{ deptBudgetList.weight }}
  247. </div>
  248. <el-button class="add" type="primary" size="small" @click="add()">
  249. <!-- <img width="22" height="22" src="../../../public/img/add.png" alt="" /> -->
  250. <div class="spans">添加司机</div>
  251. </el-button>
  252. <el-button class="add" type="primary" size="small" @click="addteam()">
  253. <div class="spans">添加车队</div>
  254. </el-button>
  255. <div style="text-align: right; padding: 10px">
  256. <el-button class="bg-bottom-up" type="primary" size="small" @click="submit()">提交</el-button>
  257. </div>
  258. </div>
  259. </el-form>
  260. </div>
  261. </div>
  262. </template>
  263. <script>
  264. import Pagination from '@/components/Pagination'
  265. import WsUpload from '@/components/WsUpload'
  266. import {
  267. seeCat,
  268. nameXiala,
  269. arrange,
  270. dispatchCat,
  271. delhaulagestage,
  272. setUpTranPrice,
  273. setUpTranPriceCar
  274. } from '@/model/transport/index'
  275. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  276. import {
  277. dayjs,
  278. EventBus
  279. } from 'base-core-lib'
  280. export default {
  281. name: 'viewSpareMoney',
  282. components: {
  283. WsUpload,
  284. Pagination,
  285. },
  286. watch: {
  287. // vesselId(val) {
  288. // this.getList()
  289. // },
  290. isShow(val) {
  291. this.showType = val
  292. },
  293. },
  294. data() {
  295. return {
  296. fhaddress: '',
  297. shaddress: '',
  298. // 是否显示
  299. showType: true,
  300. deptBudgetTotal: 0,
  301. currentPage: 1,
  302. pageSize: 10,
  303. pricetype:'1',
  304. searchType: 1,
  305. startDate: null,
  306. endDate: null,
  307. carList: [],
  308. // 提交类型
  309. readonly: true,
  310. tranPriceApprove: {},
  311. size: 10,
  312. compId: localStorage.getItem('ws-pf_compId'),
  313. date: {
  314. year: dayjs().format('YYYY'),
  315. month: dayjs().format('MM'),
  316. },
  317. deptBudgetList: {
  318. tranCarInfoList: [],
  319. },
  320. pickerBeginDateBefore: {
  321. disabledDate: (time) => {
  322. return time.getTime() > Date.now()
  323. },
  324. },
  325. accessoryTFs: false,
  326. index: 0,
  327. }
  328. },
  329. activated() {
  330. this.getList()
  331. },
  332. computed: {
  333. total: function() {
  334. if (this.deptBudgetList.tranCarInfoList.length > 0) {
  335. var maxStorage = 0
  336. for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  337. if(this.deptBudgetList.tranCarInfoList[i].loadWeight){
  338. maxStorage += Number(
  339. this.deptBudgetList.tranCarInfoList[i].loadWeight
  340. )
  341. }
  342. }
  343. return maxStorage
  344. }
  345. },
  346. teamlist: function() {
  347. if (this.deptBudgetList.tranCarInfoList.length > 0) {
  348. var arr = []
  349. for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  350. if(this.deptBudgetList.tranCarInfoList[i].fleetFlag==1){
  351. arr.push(this.deptBudgetList.tranCarInfoList[i])
  352. }
  353. }
  354. return arr
  355. }
  356. },
  357. driverlist: function() {
  358. if (this.deptBudgetList.tranCarInfoList.length > 0) {
  359. var arr = []
  360. for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  361. if(this.deptBudgetList.tranCarInfoList[i].fleetFlag==0){
  362. arr.push(this.deptBudgetList.tranCarInfoList[i])
  363. }
  364. }
  365. return arr
  366. }
  367. },
  368. },
  369. methods: {
  370. pricetypechange(e){
  371. console.log(e)
  372. this.deptBudgetList.billingMethod=e
  373. if (this.deptBudgetList.tranCarInfoList.length > 0) {
  374. for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  375. if(!this.deptBudgetList.tranCarInfoList[i].id){
  376. this.deptBudgetList.tranCarInfoList[i].billingMethod=e
  377. if(e==1){
  378. this.deptBudgetList.tranCarInfoList[i].tranPrice=this.deptBudgetList.tranPrice
  379. }else{
  380. this.deptBudgetList.tranCarInfoList[i].tranPrice=this.deptBudgetList.tranPriceCar
  381. }
  382. }
  383. }
  384. }
  385. },
  386. clearBlur(e) {
  387. let k = this.$refs.driverSelect
  388. if (!e) {
  389. for (let i = 0; i < k.length; i++) {
  390. k[i].blur()
  391. }
  392. }
  393. },
  394. //返回按钮
  395. revert() {
  396. this.$router.go(-1)
  397. },
  398. del(index, row,status) {
  399. if (row.status == null) {
  400. if(status==1){
  401. if (this.deptBudgetList.tranCarInfoList.length > 1) {
  402. for (let i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  403. console.log(this.deptBudgetList.tranCarInfoList[i])
  404. if(this.deptBudgetList.tranCarInfoList[i].index){
  405. if(this.deptBudgetList.tranCarInfoList[i].index==row.index){
  406. this.deptBudgetList.tranCarInfoList.splice(i, 1)
  407. }
  408. }
  409. }
  410. }
  411. }else{
  412. if (this.deptBudgetList.tranCarInfoList.length > 1) {
  413. this.deptBudgetList.tranCarInfoList.splice(index, 1)
  414. for (let i = index; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  415. let number = Number(this.deptBudgetList.tranCarInfoList[i].tranCarNo.split('C')[1]) - 1
  416. if (number < 10) {
  417. this.deptBudgetList.tranCarInfoList[i].tranCarNo = 'C00' + number
  418. } else if (number < 100) {
  419. this.deptBudgetList.tranCarInfoList[i].tranCarNo = 'C0' + number
  420. } else {
  421. this.deptBudgetList.tranCarInfoList[i].tranCarNo = 'C' + number
  422. }
  423. }
  424. }
  425. }
  426. } else {
  427. this.$confirm('派车信息删除后不可恢复,是否确定删除?', '提示', {
  428. confirmButtonText: '确定',
  429. cancelButtonText: '取消',
  430. type: 'warning',
  431. }).then(() => {
  432. delhaulagestage({
  433. id: row.id
  434. })
  435. .toPromise()
  436. .then((response) => {
  437. this.$message.success('删除成功')
  438. if (this.deptBudgetList.tranCarInfoList.length > 1) {
  439. this.deptBudgetList.tranCarInfoList.splice(index, 1)
  440. }
  441. this.getList()
  442. })
  443. })
  444. }
  445. },
  446. addteam(){
  447. if(this.pricetype==1){
  448. if (!this.deptBudgetList.tranPrice) {
  449. this.$message({
  450. message: '请设置运输单价(元/吨)!',
  451. type: 'warning',
  452. })
  453. } else {
  454. this.deptBudgetList.tranCarInfoList.push({
  455. fleetName:'',
  456. fleetFlag:1,
  457. index:this.deptBudgetList.tranCarInfoList.length,
  458. billingMethod:this.pricetype,
  459. tranPrice:this.deptBudgetList.tranPrice,
  460. tranType: '1',
  461. })
  462. }
  463. }else{
  464. if (!this.deptBudgetList.tranPriceCar) {
  465. this.$message({
  466. message: '请设置运输单价(元/车)!',
  467. type: 'warning',
  468. })
  469. } else {
  470. this.deptBudgetList.tranCarInfoList.push({
  471. fleetName:'',
  472. fleetFlag:1,
  473. index:this.deptBudgetList.tranCarInfoList.length,
  474. billingMethod:this.pricetype,
  475. tranPrice:this.deptBudgetList.tranPriceCar,
  476. tranType: '1',
  477. })
  478. }
  479. }
  480. },
  481. add() {
  482. if(this.pricetype==1){
  483. if (!this.deptBudgetList.tranPrice) {
  484. this.$message({
  485. message: '请设置运输单价(元/吨)!',
  486. type: 'warning',
  487. })
  488. } else {
  489. var tmp1 = 'C00'
  490. this.deptBudgetList.count++
  491. if (this.deptBudgetList.tranCarInfoList.length < 10) {
  492. this.deptBudgetList.tranCarInfoList.push({
  493. driverName: '',
  494. driverPhone: '',
  495. carLength: 0,
  496. carLengthKey: '',
  497. loadWeight: null,
  498. carModel: '',
  499. carModelKey: '',
  500. carNumber: '',
  501. disabled: false,
  502. tranType: '1',
  503. fleetFlag:0,
  504. tranPriceCar:this.deptBudgetList.tranPriceCar,
  505. billingMethod:this.pricetype,
  506. // tranCarNo: tmp1+(this.deptBudgetList.count),
  507. tranCarNo: 'C00' + (this.deptBudgetList.tranCarInfoList.length + 1),
  508. tranPrice: this.deptBudgetList.tranPrice
  509. })
  510. } else if (this.deptBudgetList.tranCarInfoList.length < 100 && this.deptBudgetList.tranCarInfoList.length >=
  511. 10) {
  512. tmp1 = 'C0'
  513. this.deptBudgetList.count++
  514. this.deptBudgetList.tranCarInfoList.push({
  515. driverName: '',
  516. driverPhone: '',
  517. carLength: 0,
  518. carLengthKey: '',
  519. loadWeight: null,
  520. carModel: '',
  521. carModelKey: '',
  522. carNumber: '',
  523. disabled: false,
  524. fleetFlag:0,
  525. tranType: '1',
  526. tranPriceCar:this.deptBudgetList.tranPriceCar,
  527. billingMethod:this.pricetype,
  528. // tranCarNo: tmp1+(this.deptBudgetList.count),
  529. tranCarNo: 'C0' + (this.deptBudgetList.tranCarInfoList.length + 1),
  530. tranPrice: this.deptBudgetList.tranPrice
  531. })
  532. } else if (this.deptBudgetList.tranCarInfoList.length < 1000 && this.deptBudgetList.tranCarInfoList.length >=
  533. 100) {
  534. tmp1 = 'C'
  535. this.deptBudgetList.count++
  536. this.deptBudgetList.tranCarInfoList.push({
  537. driverName: '',
  538. driverPhone: '',
  539. carLength: 0,
  540. carLengthKey: '',
  541. loadWeight: null,
  542. carModel: '',
  543. carModelKey: '',
  544. carNumber: '',
  545. disabled: false,
  546. fleetFlag:0,
  547. tranType: '1',
  548. billingMethod:this.pricetype,
  549. tranPriceCar:this.deptBudgetList.tranPriceCar,
  550. // tranCarNo: tmp1+(this.deptBudgetList.count),
  551. tranCarNo: 'C' + (this.deptBudgetList.tranCarInfoList.length + 1),
  552. tranPrice: this.deptBudgetList.tranPrice
  553. })
  554. }
  555. }
  556. }else{
  557. if (!this.deptBudgetList.tranPriceCar) {
  558. this.$message({
  559. message: '请设置运输单价(元/车)!',
  560. type: 'warning',
  561. })
  562. } else {
  563. var tmp1 = 'C00'
  564. this.deptBudgetList.count++
  565. if (this.deptBudgetList.tranCarInfoList.length < 10) {
  566. this.deptBudgetList.tranCarInfoList.push({
  567. driverName: '',
  568. driverPhone: '',
  569. carLength: 0,
  570. carLengthKey: '',
  571. loadWeight: null,
  572. carModel: '',
  573. carModelKey: '',
  574. carNumber: '',
  575. disabled: false,
  576. tranType: '1',
  577. fleetFlag:0,
  578. tranPriceCar:this.deptBudgetList.tranPriceCar,
  579. billingMethod:this.pricetype,
  580. // tranCarNo: tmp1+(this.deptBudgetList.count),
  581. tranCarNo: 'C00' + (this.deptBudgetList.tranCarInfoList.length + 1),
  582. tranPrice: this.deptBudgetList.tranPrice
  583. })
  584. } else if (this.deptBudgetList.tranCarInfoList.length < 100 && this.deptBudgetList.tranCarInfoList.length >=
  585. 10) {
  586. tmp1 = 'C0'
  587. this.deptBudgetList.count++
  588. this.deptBudgetList.tranCarInfoList.push({
  589. driverName: '',
  590. driverPhone: '',
  591. carLength: 0,
  592. carLengthKey: '',
  593. loadWeight: null,
  594. carModel: '',
  595. carModelKey: '',
  596. carNumber: '',
  597. disabled: false,
  598. fleetFlag:0,
  599. tranType: '1',
  600. tranPriceCar:this.deptBudgetList.tranPriceCar,
  601. billingMethod:this.pricetype,
  602. // tranCarNo: tmp1+(this.deptBudgetList.count),
  603. tranCarNo: 'C0' + (this.deptBudgetList.tranCarInfoList.length + 1),
  604. tranPrice: this.deptBudgetList.tranPrice
  605. })
  606. } else if (this.deptBudgetList.tranCarInfoList.length < 1000 && this.deptBudgetList.tranCarInfoList.length >=
  607. 100) {
  608. tmp1 = 'C'
  609. this.deptBudgetList.count++
  610. this.deptBudgetList.tranCarInfoList.push({
  611. driverName: '',
  612. driverPhone: '',
  613. carLength: 0,
  614. carLengthKey: '',
  615. loadWeight: null,
  616. carModel: '',
  617. carModelKey: '',
  618. carNumber: '',
  619. disabled: false,
  620. fleetFlag:0,
  621. tranType: '1',
  622. billingMethod:this.pricetype,
  623. tranPriceCar:this.deptBudgetList.tranPriceCar,
  624. // tranCarNo: tmp1+(this.deptBudgetList.count),
  625. tranCarNo: 'C' + (this.deptBudgetList.tranCarInfoList.length + 1),
  626. tranPrice: this.deptBudgetList.tranPrice
  627. })
  628. }
  629. }
  630. }
  631. },
  632. //审核
  633. examine(status) {
  634. this.$prompt('运输单价审核', {
  635. cancelButtonText: '取消',
  636. confirmButtonText: '确定',
  637. inputValue: status==1?this.deptBudgetList.tranPriceIng:this.deptBudgetList.tranPriceIngCar
  638. }).then(({
  639. value
  640. }) => {
  641. var tranProcessInfo = {}
  642. tranProcessInfo.reviewer = localStorage.getItem('ws-pf_roleName') +
  643. localStorage.getItem('ws-pf_staffName')
  644. tranProcessInfo.id = this.deptBudgetList.id
  645. tranProcessInfo.flag = '2'
  646. tranProcessInfo.tranTypeKey = 1
  647. tranProcessInfo.billingMethod= this.deptBudgetList.billingMethod
  648. if(this.deptBudgetList.billingMethod==2){
  649. tranProcessInfo.tranPriceIngCar=value
  650. setUpTranPriceCar(tranProcessInfo)
  651. .toPromise()
  652. .then((response) => {
  653. this.$message.success('提交成功')
  654. this.getList()
  655. })
  656. }else{
  657. tranProcessInfo.tranPriceIng = value
  658. setUpTranPrice(tranProcessInfo)
  659. .toPromise()
  660. .then((response) => {
  661. this.$message.success('审核成功')
  662. this.getList()
  663. });
  664. }
  665. }).catch(() => {
  666. this.$message.warning(
  667. '取消审核'
  668. );
  669. });
  670. },
  671. priceSubmit(status) {
  672. this.$confirm(`运输单价将发送给决策人审核,确定提交?`, {
  673. cancelButtonText: '取消',
  674. confirmButtonText: '确定',
  675. type: 'warning',
  676. })
  677. .then(() => {
  678. var tranProcessInfo = {}
  679. tranProcessInfo.id = this.deptBudgetList.id
  680. tranProcessInfo.flag = '1'
  681. tranProcessInfo.tranTypeKey = 1
  682. tranProcessInfo.tranPriceIng = this.deptBudgetList.tranPriceIng
  683. if(!this.deptBudgetList.billingMethod) this.deptBudgetList.billingMethod=1
  684. tranProcessInfo.billingMethod= this.deptBudgetList.billingMethod
  685. tranProcessInfo.tranPriceIngCar = this.deptBudgetList.tranPriceIngCar
  686. if(status==2){
  687. setUpTranPriceCar(tranProcessInfo)
  688. .toPromise()
  689. .then((response) => {
  690. this.$message.success('提交成功')
  691. this.getList()
  692. })
  693. }else{
  694. setUpTranPrice(tranProcessInfo)
  695. .toPromise()
  696. .then((response) => {
  697. this.$message.success('提交成功')
  698. this.getList()
  699. })
  700. }
  701. })
  702. .catch(() => {
  703. return false
  704. })
  705. },
  706. //提交按钮
  707. submit() {
  708. if (!this.deptBudgetList.tranPrice) {
  709. this.$message({
  710. message: '请设置运输单价!',
  711. type: 'warning',
  712. })
  713. } else {
  714. for (var i = this.index; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  715. if (!this.deptBudgetList.tranCarInfoList[i].driver&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==0) {
  716. this.$message({
  717. message: '姓名不能为空!',
  718. type: 'warning',
  719. })
  720. return
  721. }
  722. if (!this.deptBudgetList.tranCarInfoList[i].fleetName&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==1) {
  723. this.$message({
  724. message: '车队名称不能为空!',
  725. type: 'warning',
  726. })
  727. return
  728. }
  729. if (this.deptBudgetList.tranCarInfoList[i].fleetName&&this.deptBudgetList.tranCarInfoList[i].fleetName.length<1&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==1||this.deptBudgetList.tranCarInfoList[i].fleetName&&this.deptBudgetList.tranCarInfoList[i].fleetName.length>10&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==1) {
  730. this.$message({
  731. message: '车队名称1-10个字!',
  732. type: 'warning',
  733. })
  734. return
  735. }
  736. for (var j = 0; j < this.carList.length; j++) {
  737. if (this.carList[j].driverName == this.deptBudgetList.tranCarInfoList[i].driver && this.carList[j]
  738. .disableStatusFlag == 1) {
  739. this.$message({
  740. message: this.deptBudgetList.tranCarInfoList[i].driver + '该司机已被禁用!',
  741. type: 'warning',
  742. })
  743. return
  744. }
  745. }
  746. }
  747. this.$confirm(`确定提交派车信息?`, {
  748. cancelButtonText: '取消',
  749. confirmButtonText: '确定',
  750. type: 'warning',
  751. })
  752. .then(() => {
  753. this.$refs.deptBudgetList.validate((valid) => {
  754. if (valid) {
  755. var tranCarInfo = {}
  756. tranCarInfo.id = this.deptBudgetList.id
  757. tranCarInfo.processNo = this.deptBudgetList.processNo
  758. tranCarInfo.tranPrice = this.deptBudgetList.tranPrice
  759. tranCarInfo.infoId = this.deptBudgetList.infoId
  760. tranCarInfo.billingMethod=this.pricetype
  761. tranCarInfo.tranCarInfoList = this.deptBudgetList.tranCarInfoList
  762. dispatchCat(tranCarInfo)
  763. .toPromise()
  764. .then((response) => {
  765. this.$message.success('提交成功')
  766. this.$router.go(-1)
  767. })
  768. } else {
  769. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  770. return false
  771. }
  772. })
  773. })
  774. .catch(() => {
  775. return false
  776. })
  777. }
  778. },
  779. handleClose() {
  780. this.accessoryTFs = false
  781. },
  782. getList() {
  783. seeCat({
  784. id: this.$route.query.id
  785. })
  786. .toPromise()
  787. .then((response) => {
  788. if (response.tranCarInfoList.length > 0) {
  789. this.index = response.tranCarInfoList.length
  790. for (var i = 0; i < response.tranCarInfoList.length; i++) {
  791. if (response.tranCarInfoList[i].id) {
  792. response.tranCarInfoList[i].disabled = true
  793. }
  794. }
  795. }
  796. if(response.billingMethod){
  797. this.pricetype=response.billingMethod
  798. }
  799. this.deptBudgetList = response
  800. this.fhaddress = response.sendPrivate + response.sendCity + response.sendArea + response
  801. .sendDetailedAddress
  802. this.shaddress = response.receivePrivate + response.receiveCity + response.receiveArea + response
  803. .receiveDetailedAddress
  804. if (this.deptBudgetList.tranPriceIng == 0) {
  805. this.deptBudgetList.tranPriceIng = ''
  806. }
  807. if (this.deptBudgetList.tranCarInfoList.length == 0) {
  808. this.deptBudgetList.tranCarInfoList = [{
  809. driverName: '',
  810. driverPhone: '',
  811. carLength: 0,
  812. carLengthKey: '',
  813. loadWeight: null,
  814. carModel: '',
  815. carModelKey: '',
  816. carNumber: '',
  817. disabled: false,
  818. fleetFlag:0,
  819. tranType: '1',
  820. tranCarNo: 'C001',
  821. billingMethod:1,
  822. tranPrice: this.deptBudgetList.tranPrice
  823. }, ]
  824. }
  825. })
  826. nameXiala({
  827. compId: this.compId
  828. })
  829. .toPromise()
  830. .then((response) => {
  831. this.carList = response
  832. })
  833. },
  834. carchange(val, index) {
  835. for (var i = 0; i < this.carList.length; i++) {
  836. if (this.carList[i].driverName == val) {
  837. this.deptBudgetList.tranCarInfoList[index].driverPhone =
  838. this.carList[i].driverPhone
  839. arrange({
  840. id: this.carList[i].id
  841. })
  842. .toPromise()
  843. .then((response) => {
  844. this.deptBudgetList.tranCarInfoList[index].carNo =
  845. response.carNumber
  846. if (response.carLoad != null) {
  847. this.deptBudgetList.tranCarInfoList[index].loadWeight =
  848. response.carLoad
  849. } else {
  850. this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
  851. }
  852. this.deptBudgetList.tranCarInfoList[index].carModel =
  853. response.carModel
  854. this.deptBudgetList.tranCarInfoList[index].carLength =
  855. response.carLength
  856. this.deptBudgetList.tranCarInfoList[index].carLengthKey =
  857. response.carLengthKey
  858. this.deptBudgetList.tranCarInfoList[index].carModelKey =
  859. response.carModelKey
  860. this.$forceUpdate()
  861. })
  862. }
  863. }
  864. },
  865. phonechange(val, index) {
  866. for (var i = 0; i < this.carList.length; i++) {
  867. if (this.carList[i].driverPhone == val) {
  868. this.deptBudgetList.tranCarInfoList[index].driver =
  869. this.carList[i].driverName
  870. arrange({
  871. id: this.carList[i].id
  872. })
  873. .toPromise()
  874. .then((response) => {
  875. console.log(this, response)
  876. this.deptBudgetList.tranCarInfoList[index].carNo =
  877. response.carNumber
  878. if (response.carLoad != null) {
  879. this.deptBudgetList.tranCarInfoList[index].loadWeight =
  880. response.carLoad
  881. } else {
  882. this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
  883. }
  884. this.deptBudgetList.tranCarInfoList[index].carModel =
  885. response.carModel
  886. this.deptBudgetList.tranCarInfoList[index].carLength =
  887. response.carLength
  888. this.deptBudgetList.tranCarInfoList[index].carLengthKey =
  889. response.carLengthKey
  890. this.deptBudgetList.tranCarInfoList[index].carModelKey =
  891. response.carModelKey
  892. })
  893. }
  894. }
  895. },
  896. },
  897. }
  898. </script>
  899. <style lang="scss" scoped>
  900. // /deep/.basicInformation {
  901. // .ws-info-table {
  902. // border: none;
  903. // }
  904. // .myTest {
  905. // width: 800px;
  906. // display: flex;
  907. // height: 40px;
  908. // }
  909. // .el-form-item {
  910. // width: 33.3333%;
  911. // border: none;
  912. // height: 50px;
  913. // .el-form-item__label {
  914. // background: transparent;
  915. // border: none;
  916. // }
  917. // .el-form-item__content {
  918. // border: none;
  919. // }
  920. // }
  921. // }
  922. // .title {
  923. // position: relative;
  924. // padding-left: 10px;
  925. // }
  926. // .title::before {
  927. // content: '';
  928. // display: inline-block;
  929. // width: 5px;
  930. // height: 30px;
  931. // background: #5473e8;
  932. // position: absolute;
  933. // left: 0;
  934. // }
  935. // .el-form {
  936. // padding: 0 10%;
  937. // }
  938. // .el-button--primary {
  939. // background-color: #5878e8;
  940. // border-color: #5878e8;
  941. // }
  942. // .el-col {
  943. // background: #f6f7fc;
  944. // }
  945. // .bg-right {
  946. // text-align: right;
  947. // padding: 16px 20px;
  948. // }
  949. // .center {
  950. // margin: 0 auto;
  951. // width: 70%;
  952. // }
  953. //表格文字
  954. // /deep/.ws-info-table .el-form-item .el-form-item__label {
  955. // text-align: center;
  956. // font-size: 14px;
  957. // font-weight: 400;
  958. // color: #8890b1;
  959. // line-height: 16px;
  960. // }
  961. // //蓝标
  962. // .small-title {
  963. // position: relative;
  964. // padding: 10px;
  965. // font-weight: 600;
  966. // }
  967. // .small-title::before {
  968. // position: absolute;
  969. // content: '';
  970. // display: block;
  971. // background: #5473e8;
  972. // width: 4px;
  973. // height: 14px;
  974. // left: 0px;
  975. // top: 13px;
  976. // padding: 4px 2px;
  977. // }
  978. // .position {
  979. // position: relative;
  980. // }
  981. // .position .zaizhong {
  982. // width: 16%;
  983. // }
  984. // //减号
  985. // .del {
  986. // position: absolute;
  987. // // right: -38px;
  988. // top: 9px;
  989. // cursor: pointer;
  990. // right: 0;
  991. // display: inline-block;
  992. // font-size: 20px;
  993. // width: 20px;
  994. // height: 10px;
  995. // line-height: 0px;
  996. // }
  997. // .driver .el-form-item {
  998. // width: 16.63%;
  999. // }
  1000. // /deep/.ws-info-table .el-form-item .el-form-item__content {
  1001. // background: #f5f7fa;
  1002. // border-radius: 4px;
  1003. // color: #8890b1;
  1004. // font-size: 14px;
  1005. // padding: 0 25px;
  1006. // }
  1007. // /deep/.driver .ws-info-table .el-form-item .el-form-item__label {
  1008. // width: 72px;
  1009. // }
  1010. // /deep/.liaison .ws-info-table .el-form-item {
  1011. // width: 220px;
  1012. // color: #8890b1;
  1013. // font-size: 14px;
  1014. // }
  1015. // /deep/.ws-info-table .el-form-item {
  1016. // border: none;
  1017. // height: 50px;
  1018. // }
  1019. // /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
  1020. // width: 50%;
  1021. // border: 0px solid #d8dce6;
  1022. // background: #f5f7fa;
  1023. // text-align: center;
  1024. // }
  1025. // /deep/.liaison {
  1026. // background: #f5f7fa;
  1027. // border-radius: 4px;
  1028. // border: 0px solid #d8dce6;
  1029. // }
  1030. // /deep/.liaison .ws-info-table .el-form-item .el-form-item__content {
  1031. // border: none;
  1032. // background: #f5f7fa;
  1033. // padding: 0px;
  1034. // }
  1035. // .catNos {
  1036. // width: 100%;
  1037. // height: 30px;
  1038. // margin-top: 10px;
  1039. // margin-left: 20px;
  1040. // font-size: 14px;
  1041. // }
  1042. // /deep/.liaison .ws-info-table .el-form-item .el-form-item__content {
  1043. // border-radius: 0px;
  1044. // border-left: none;
  1045. // border-bottom: none;
  1046. // border-top: none;
  1047. // }
  1048. // /deep/.liaison .ws-info-table {
  1049. // background: #f6f7fc;
  1050. // border-radius: 4px;
  1051. // border: 1px solid #d8dce6;
  1052. // margin-top: 20px;
  1053. // }
  1054. //送达/未送达
  1055. // .noservice,
  1056. // .service {
  1057. // display: inline-block;
  1058. // border-radius: 4px;
  1059. // border: 1px solid #d8dce6;
  1060. // padding: 2px;
  1061. // font-size: 12px;
  1062. // }
  1063. // .noservice {
  1064. // background: #c4cada;
  1065. // color: #ffffff;
  1066. // }
  1067. // .service {
  1068. // background: #e5f1f7;
  1069. // color: #50cad4;
  1070. // }
  1071. // .serviced {
  1072. // display: inline-block;
  1073. // border-radius: 4px;
  1074. // border: 1px solid #d8dce6;
  1075. // padding: 2px;
  1076. // font-size: 12px;
  1077. // background: #e5f1f7;
  1078. // color: #2c81cf;
  1079. // }
  1080. // //添加司机
  1081. // .add {
  1082. // width: 100px;
  1083. // height: 34px;
  1084. // background: #f6f7fb;
  1085. // border-radius: 17px;
  1086. // color: #5473e8;
  1087. // font-size: 14px;
  1088. // border: none;
  1089. // }
  1090. // .add img {
  1091. // display: inline-block;
  1092. // margin-top: 3px;
  1093. // margin-left: -12px;
  1094. // }
  1095. // .add .spans {
  1096. // display: table-caption;
  1097. // width: 56px;
  1098. // height: 20px;
  1099. // line-height: 18px;
  1100. // }
  1101. /deep/.el-form-item--small.el-form-item {
  1102. margin-bottom: 0px
  1103. }
  1104. .input-item-margin {
  1105. margin-right: 20px;
  1106. }
  1107. .row-item {
  1108. width: 100%;
  1109. }
  1110. .bg-right {
  1111. text-align: right;
  1112. padding: 16px 20px;
  1113. }
  1114. .center {
  1115. margin: 0 auto;
  1116. width: 70%;
  1117. }
  1118. //蓝标
  1119. .small-title {
  1120. position: relative;
  1121. padding: 10px;
  1122. font-weight: 600;
  1123. }
  1124. //小标题文字
  1125. .small-title::before {
  1126. position: absolute;
  1127. content: '';
  1128. display: block;
  1129. background: #5473e8;
  1130. width: 4px;
  1131. height: 14px;
  1132. left: 0px;
  1133. top: 16px;
  1134. padding: 4px 2px;
  1135. }
  1136. .bg-left {
  1137. padding-left: 30px;
  1138. }
  1139. .title::before {
  1140. content: '';
  1141. display: inline-block;
  1142. width: 5px;
  1143. height: 30px;
  1144. background: #5473e8;
  1145. position: absolute;
  1146. left: 0;
  1147. }
  1148. .myTest {
  1149. display: flex;
  1150. margin-bottom: 20px;
  1151. // background: green;
  1152. padding-left: 20px;
  1153. align-items: center;
  1154. width: 800px;
  1155. }
  1156. .myTest .el-form-item {
  1157. width: 33.333%;
  1158. }
  1159. .content3 ,.contentitem{
  1160. width: calc(100% + 20px);
  1161. .content3-item1 {
  1162. position: relative;
  1163. background: #F5F7FA;
  1164. border: 1px solid #E4E7ED;
  1165. border-radius: 5px;
  1166. height: 200px;
  1167. width: 100%;
  1168. padding: 10px 20px 0 0;
  1169. margin-top: 20px;
  1170. }
  1171. }
  1172. .contentitem{
  1173. .content3-item1 {
  1174. height: 90px;
  1175. }
  1176. }
  1177. .content4 {
  1178. background: #F5F7FA;
  1179. display: flex;
  1180. margin: 10px 0;
  1181. border: 1px solid #E4E7ED;
  1182. border-radius: 5px;
  1183. position: relative;
  1184. }
  1185. .del {
  1186. position: absolute;
  1187. right: 4px;
  1188. top: 0px;
  1189. cursor: pointer;
  1190. font-size: 20px;
  1191. width: 16px;
  1192. height: 10px;
  1193. }
  1194. </style>