1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261 |
- // 汽车调度派车
- <template>
- <div class="container">
- <el-row>
- <el-col :span="20">
- <h2 class="bg-left title">汽车调度</h2>
- </el-col>
- <el-col :span="4" class="bg-right">
- <el-button class="bg-bottom" type="primary" size="small" @click="revert()"><img width="6" height="10"
- style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
- </el-button>
- </el-col>
- </el-row>
- <div class="center">
- <el-form ref="deptBudgetList" :model="deptBudgetList" label-width="110px">
- <div class="basicInformation">
- <div class="small-title" style="font-size: 16px">任务详情</div>
- <el-row>
- <el-col :span="8">
- <el-form-item label="任务编号" span="1" prop="processNo">
- <el-input type="text" class="row-item" v-model="deptBudgetList.processNo" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="货名" span="1">
- <el-input type="text" class="row-item" v-model="deptBudgetList.goodsName" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="重量(吨)" span="1" prop="tare" class="readonly">
- <el-input type="text" class="row-item" v-model="deptBudgetList.weight" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="发货地址" span="1" prop="netWeight">
- <el-input type="text" class="row-item" v-model="fhaddress" disabled></el-input>
- <!-- {{ deptBudgetList.sendPrivate }}{{ deptBudgetList.sendCity
- }}{{ deptBudgetList.sendArea
- }}{{ deptBudgetList.sendDetailedAddress }} -->
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="发货人" span="1" prop="agent">
- <el-input type="text" class="row-item" v-model="deptBudgetList.sender" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="发货人电话" span="1" prop="agent">
- <el-input type="text" class="row-item" v-model="deptBudgetList.senderPhone" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="收货地址" span="1" prop="netWeight">
- <el-input type="text" class="row-item" v-model="shaddress" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="收货人电话" span="1" prop="receiverPhone">
- <el-input type="text" class="row-item" v-model="deptBudgetList.receiverPhone" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="发货日期" span="1" prop="inOutDate" class="deliverydate">
- <el-input type="text" class="row-item" v-model="deptBudgetList.deliveryDateStart" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="最晚到货日期" span="1" prop="inOutDate" class="deliverydate">
- <el-input type="text" class="row-item" v-model="deptBudgetList.deliveryDateEnd" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item v-if="deptBudgetList.taskType=='移库'" label="移库编号" span="1" prop="contractNo">
- <el-input type="text" class="row-item" v-model="deptBudgetList.contractNo" disabled></el-input>
- </el-form-item>
- <el-form-item v-else label="合同编号" span="1" prop="contractNo">
- <el-input type="text" class="row-item" v-model="deptBudgetList.contractNo" disabled></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="关联合同" v-if="deptBudgetList.relatedContract" span="1" prop="inOutDate"
- class="relatedContract">
- <el-input type="text" class="row-item" v-model="deptBudgetList.relatedContract" disabled></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <div class="small-title" style="font-size: 16px">派车
- <el-radio-group @change='pricetypechange' v-model="pricetype">
- <el-radio label="1">元/吨计费</el-radio>
- <el-radio label="2">元/车计费</el-radio>
- </el-radio-group>
- </div>
-
- <div class="myTest">
-
- <el-form-item v-if='pricetype==1' label="当前运输单价(元/吨):" prop="tranPrice" label-width="150px" class="input-item-margin">
- <el-input v-model="deptBudgetList.tranPrice" maxlength="70" disabled />
- </el-form-item>
- <el-form-item v-else label="当前运输单价(元/车):" prop="tranPrice" label-width="150px" class="input-item-margin">
- <el-input v-model="deptBudgetList.tranPriceCar" maxlength="70" disabled />
- </el-form-item>
- <el-form-item v-if='pricetype==1' label="审核中的运输总价(元/吨):" prop="tranPriceIng" label-width="180px" class="input-item-margin">
- <el-input v-if="deptBudgetList.priceStatus=='审核中'" :disabled="readonly"
- v-model="deptBudgetList.tranPriceIng" maxlength="70" />
- <el-input v-else v-model="deptBudgetList.tranPriceIng" maxlength="70" />
- </el-form-item>
- <el-form-item v-else label="审核中的运输总价(元/车):" prop="tranPriceIng" label-width="180px" class="input-item-margin">
- <el-input v-if="deptBudgetList.priceStatusCar=='审核中'" :disabled="readonly"
- v-model="deptBudgetList.tranPriceIngCar" maxlength="70" />
- <el-input v-else v-model="deptBudgetList.tranPriceIngCar" maxlength="70" />
- </el-form-item>
- <div class="input-item-margin">
- <div v-if="deptBudgetList.priceStatus=='审核中'&&pricetype==1">
- <el-button type="primary" v-hasPermission="`tranManager.vehicleDispatching.reprice`" size="small"
- @click="examine(1)">审核中
- </el-button>
- </div>
- <el-button v-if="deptBudgetList.priceStatus!='审核中'&&pricetype==1" type="primary" @click="priceSubmit(1)">提交</el-button>
- <div v-if="deptBudgetList.priceStatusCar=='审核中'&&pricetype==2">
- <el-button type="primary" v-hasPermission="`tranManager.vehicleDispatching.reprice`" size="small"
- @click="examine(2)">审核中
- </el-button>
- </div>
- <el-button v-if="deptBudgetList.priceStatusCar!='审核中'&&pricetype==2" type="primary" @click="priceSubmit(2)">提交</el-button>
- </div>
- </div>
- <div class="content3" v-for="(item, index) in driverlist" :key="index">
- <div class="content3-item1">
- <div class="">
- <span style="margin-left: 30px;font-weight: 600;">司机-{{ index + 1 }}</span>
- <span class="noservice" v-show="item.status == '未装车'">{{
- item.status
- }}</span>
- <span class="service" v-show="item.status == '已装车'">{{
- item.status
- }}</span>
- <span class="serviced" v-show="item.status == '已送达'">{{
- item.status
- }}</span>
- </div>
- <el-col :span="8">
- <el-form-item label="姓名:" span="1" prop="driverName" label-width="125px">
- <el-select ref="driverSelect" v-show="!item.temporaryDriverFlag" @visible-change="clearBlur"
- v-model="item.driver" filterable clearable placeholder="请选择司机" class="row-item" @change="
- (val) => {
- carchange(val, index)
- }
- ">
- <el-option v-for="(items, index) in carList" :key="index" :label="items.driverName"
- :value="items.driverName" />
- </el-select>
- <span v-show="
- item.temporaryDriverFlag == 0 ||
- item.temporaryDriverFlag == 1
- ">{{ item.driver }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="司机电话:" span="1" prop="impurity" label-width="125px">
- <el-select v-show="!item.temporaryDriverFlag" v-model="item.driverPhone" placeholder="请选择司机电话"
- filterable clearable class="row-item" @change="
- (val) => {
- phonechange(val, index)
- }
- ">
- <el-option v-for="(items, index) in carList" :key="index" :label="items.driverPhone"
- :value="items.driverPhone" />
- </el-select>
- <span v-show="
- item.temporaryDriverFlag == 0 ||
- item.temporaryDriverFlag == 1
- ">{{ item.driverPhone }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="车牌号:" span="1" prop="carNo" label-width="125px">
- <el-input :disabled="readonly" v-model="item.carNo" placeholder="" maxlength="120" size="small" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="派车编号:" span="1" prop="carModel" label-width="125px">
- <el-input :disabled="readonly" v-model="item.tranCarNo" maxlength="120" size="small" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="箱号:" span="1" prop="carModel" label-width="125px">
- <el-input v-if="item.status == '已装车'||item.status == '已送达'" :disabled="readonly" v-model="item.caseNo"
- maxlength="120" size="small" />
- <el-input v-else v-model="item.caseNo" placeholder="请输入箱号" maxlength="120" size="small" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="封号:" span="1" prop="carModel" label-width="125px">
- <el-input v-if="item.status == '已装车'||item.status == '已送达'" v-model="item.titleNo" placeholder=""
- :disabled="readonly" maxlength="120" size="small" />
- <el-input v-model="item.titleNo" placeholder="请输入封号" v-else maxlength="120" size="small" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="车型:" span="1" prop="carModel" label-width="125px">
- <el-input :disabled="readonly" v-model="item.carModel" placeholder="" maxlength="120" size="small" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="车长:" span="1" prop="carLength" label-width="125px">
- <el-input :disabled="readonly" v-model="item.carLength" placeholder="" maxlength="120" size="small" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="载重(吨):" span="1" prop="loadWeight" label-width="125px">
- <el-input :disabled="readonly" v-model="item.loadWeight" placeholder="" maxlength="120"
- size="small" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item v-if='item.billingMethod==1' label="运输单价(元/吨):" span="1" prop="carModel" label-width="125px">
- <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
- </el-form-item>
- <el-form-item v-else label="运输单价(元/车):" span="1" prop="carModel" label-width="125px">
- <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
- </el-form-item>
- </el-col>
- <span v-if="item.status == '未装车'||item.temporaryDriverFlag!=0" width="22" height="22" class="del"
- @click="del(index, item,0)" src="../../../public/img/del.png" alt="">×</span>
- </div>
- </div>
- <div class="contentitem" v-for="(item, index) in teamlist" :key="'team'+index">
- <div class="content3-item1">
- <el-col :span="8">
- <!-- <span style="margin-left: 30px;font-weight: 600;">车队-{{ index + 1 }}</span> -->
- <el-form-item :label="'车队-'+(index + 1 )" span="1" prop="carModel" label-width="125px">
- <el-input :disabled="item.id?true:false" v-model="item.fleetName" size="small" />
- </el-form-item>
- </el-col>
-
- <el-col :span="8">
- <el-form-item v-if='item.billingMethod==1' label="运输单价(元/吨):" span="1" prop="carModel" label-width="125px">
- <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
- </el-form-item>
- <el-form-item v-else label="运输单价(元/车):" span="1" prop="carModel" label-width="125px">
- <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
- </el-form-item>
- </el-col>
- <span v-if="!item.id" width="22" height="22" class="del"
- @click="del(index, item,1)" src="../../../public/img/del.png" alt="">×</span>
- </div>
- </div>
- <div style="text-align: right; color: #8890b1; font-size: 16px">
- 共{{ total }}/{{ deptBudgetList.weight }}
- </div>
- <el-button class="add" type="primary" size="small" @click="add()">
- <!-- <img width="22" height="22" src="../../../public/img/add.png" alt="" /> -->
- <div class="spans">添加司机</div>
- </el-button>
- <!-- <el-button class="add" type="primary" size="small" @click="addteam()">
- <div class="spans">添加车队</div>
- </el-button> -->
- <div style="text-align: right; padding: 10px">
- <el-button class="bg-bottom-up" type="primary" size="small" @click="submit()">提交</el-button>
- </div>
- </div>
- </el-form>
- </div>
- </div>
- </template>
- <script>
- import Pagination from '@/components/Pagination'
- import WsUpload from '@/components/WsUpload'
- import {
- seeCat,
- nameXiala,
- arrange,
- dispatchCat,
- delhaulagestage,
- setUpTranPrice,
- setUpTranPriceCar
- } from '@/model/transport/index'
- // import { dayjs, fmoney, EventBus } from 'base-core-lib'
- import {
- dayjs,
- EventBus
- } from 'base-core-lib'
- export default {
- name: 'viewSpareMoney',
- components: {
- WsUpload,
- Pagination,
- },
- watch: {
- // vesselId(val) {
- // this.getList()
- // },
- isShow(val) {
- this.showType = val
- },
- },
- data() {
- return {
- fhaddress: '',
- shaddress: '',
- // 是否显示
- showType: true,
- deptBudgetTotal: 0,
- currentPage: 1,
- pageSize: 10,
- pricetype:'1',
- searchType: 1,
- startDate: null,
- endDate: null,
- carList: [],
- // 提交类型
- readonly: true,
- tranPriceApprove: {},
- size: 10,
- compId: localStorage.getItem('ws-pf_compId'),
- date: {
- year: dayjs().format('YYYY'),
- month: dayjs().format('MM'),
- },
- deptBudgetList: {
- tranCarInfoList: [],
- },
- pickerBeginDateBefore: {
- disabledDate: (time) => {
- return time.getTime() > Date.now()
- },
- },
- accessoryTFs: false,
- index: 0,
- }
- },
- activated() {
- this.getList()
- },
- computed: {
- total: function() {
- if (this.deptBudgetList.tranCarInfoList.length > 0) {
- var maxStorage = 0
- for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
- if(this.deptBudgetList.tranCarInfoList[i].loadWeight){
- maxStorage += Number(
- this.deptBudgetList.tranCarInfoList[i].loadWeight
- )
- }
-
- }
- return maxStorage
- }
- },
- teamlist: function() {
- if (this.deptBudgetList.tranCarInfoList.length > 0) {
- var arr = []
- for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
- if(this.deptBudgetList.tranCarInfoList[i].fleetFlag==1){
- arr.push(this.deptBudgetList.tranCarInfoList[i])
- }
- }
- return arr
- }
- },
- driverlist: function() {
- if (this.deptBudgetList.tranCarInfoList.length > 0) {
- var arr = []
- for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
- if(this.deptBudgetList.tranCarInfoList[i].fleetFlag==0){
- arr.push(this.deptBudgetList.tranCarInfoList[i])
- }
- }
- return arr
- }
- },
- },
- methods: {
- pricetypechange(e){
- console.log(e)
- this.deptBudgetList.billingMethod=e
- if (this.deptBudgetList.tranCarInfoList.length > 0) {
- for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
- if(!this.deptBudgetList.tranCarInfoList[i].id){
- this.deptBudgetList.tranCarInfoList[i].billingMethod=e
- if(e==1){
- this.deptBudgetList.tranCarInfoList[i].tranPrice=this.deptBudgetList.tranPrice
- }else{
- this.deptBudgetList.tranCarInfoList[i].tranPrice=this.deptBudgetList.tranPriceCar
- }
- }
- }
- }
- },
- clearBlur(e) {
- let k = this.$refs.driverSelect
- if (!e) {
- for (let i = 0; i < k.length; i++) {
- k[i].blur()
- }
- }
- },
- //返回按钮
- revert() {
- this.$router.go(-1)
- },
- del(index, row,status) {
- if (row.status == null) {
- if(status==1){
- if (this.deptBudgetList.tranCarInfoList.length > 1) {
- for (let i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
- console.log(this.deptBudgetList.tranCarInfoList[i])
- if(this.deptBudgetList.tranCarInfoList[i].index){
- if(this.deptBudgetList.tranCarInfoList[i].index==row.index){
- this.deptBudgetList.tranCarInfoList.splice(i, 1)
- }
- }
- }
- }
- }else{
- if (this.deptBudgetList.tranCarInfoList.length > 1) {
- this.deptBudgetList.tranCarInfoList.splice(index, 1)
- for (let i = index; i < this.deptBudgetList.tranCarInfoList.length; i++) {
- let number = Number(this.deptBudgetList.tranCarInfoList[i].tranCarNo.split('C')[1]) - 1
- if (number < 10) {
- this.deptBudgetList.tranCarInfoList[i].tranCarNo = 'C00' + number
- } else if (number < 100) {
- this.deptBudgetList.tranCarInfoList[i].tranCarNo = 'C0' + number
- } else {
- this.deptBudgetList.tranCarInfoList[i].tranCarNo = 'C' + number
- }
- }
- }
- }
-
- } else {
- this.$confirm('派车信息删除后不可恢复,是否确定删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- }).then(() => {
- delhaulagestage({
- id: row.id
- })
- .toPromise()
- .then((response) => {
- this.$message.success('删除成功')
- if (this.deptBudgetList.tranCarInfoList.length > 1) {
- this.deptBudgetList.tranCarInfoList.splice(index, 1)
- }
- this.getList()
- })
- })
- }
- },
- addteam(){
- if(this.pricetype==1){
- if (!this.deptBudgetList.tranPrice) {
- this.$message({
- message: '请设置运输单价(元/吨)!',
- type: 'warning',
- })
- } else {
- this.deptBudgetList.tranCarInfoList.push({
- fleetName:'',
- fleetFlag:1,
- index:this.deptBudgetList.tranCarInfoList.length,
- billingMethod:this.pricetype,
- tranPrice:this.deptBudgetList.tranPrice,
- tranType: '1',
- })
- }
- }else{
- if (!this.deptBudgetList.tranPriceCar) {
- this.$message({
- message: '请设置运输单价(元/车)!',
- type: 'warning',
- })
- } else {
- this.deptBudgetList.tranCarInfoList.push({
- fleetName:'',
- fleetFlag:1,
- index:this.deptBudgetList.tranCarInfoList.length,
- billingMethod:this.pricetype,
- tranPrice:this.deptBudgetList.tranPriceCar,
- tranType: '1',
- })
- }
- }
-
- },
- add() {
- if(this.pricetype==1){
- if (!this.deptBudgetList.tranPrice) {
- this.$message({
- message: '请设置运输单价(元/吨)!',
- type: 'warning',
- })
- } else {
- var tmp1 = 'C00'
- this.deptBudgetList.count++
- if (this.deptBudgetList.tranCarInfoList.length < 10) {
- this.deptBudgetList.tranCarInfoList.push({
- driverName: '',
- driverPhone: '',
- carLength: 0,
- carLengthKey: '',
- loadWeight: null,
- carModel: '',
- carModelKey: '',
- carNumber: '',
- disabled: false,
- tranType: '1',
- fleetFlag:0,
- tranPriceCar:this.deptBudgetList.tranPriceCar,
- billingMethod:this.pricetype,
- // tranCarNo: tmp1+(this.deptBudgetList.count),
- tranCarNo: 'C00' + (this.deptBudgetList.tranCarInfoList.length + 1),
- tranPrice: this.deptBudgetList.tranPrice
- })
- } else if (this.deptBudgetList.tranCarInfoList.length < 100 && this.deptBudgetList.tranCarInfoList.length >=
- 10) {
- tmp1 = 'C0'
- this.deptBudgetList.count++
- this.deptBudgetList.tranCarInfoList.push({
- driverName: '',
- driverPhone: '',
- carLength: 0,
- carLengthKey: '',
- loadWeight: null,
- carModel: '',
- carModelKey: '',
- carNumber: '',
- disabled: false,
- fleetFlag:0,
- tranType: '1',
- tranPriceCar:this.deptBudgetList.tranPriceCar,
- billingMethod:this.pricetype,
- // tranCarNo: tmp1+(this.deptBudgetList.count),
- tranCarNo: 'C0' + (this.deptBudgetList.tranCarInfoList.length + 1),
- tranPrice: this.deptBudgetList.tranPrice
- })
- } else if (this.deptBudgetList.tranCarInfoList.length < 1000 && this.deptBudgetList.tranCarInfoList.length >=
- 100) {
- tmp1 = 'C'
- this.deptBudgetList.count++
- this.deptBudgetList.tranCarInfoList.push({
- driverName: '',
- driverPhone: '',
- carLength: 0,
- carLengthKey: '',
- loadWeight: null,
- carModel: '',
- carModelKey: '',
- carNumber: '',
- disabled: false,
- fleetFlag:0,
- tranType: '1',
- billingMethod:this.pricetype,
- tranPriceCar:this.deptBudgetList.tranPriceCar,
- // tranCarNo: tmp1+(this.deptBudgetList.count),
- tranCarNo: 'C' + (this.deptBudgetList.tranCarInfoList.length + 1),
- tranPrice: this.deptBudgetList.tranPrice
- })
- }
- }
- }else{
- if (!this.deptBudgetList.tranPriceCar) {
- this.$message({
- message: '请设置运输单价(元/车)!',
- type: 'warning',
- })
- } else {
- var tmp1 = 'C00'
- this.deptBudgetList.count++
- if (this.deptBudgetList.tranCarInfoList.length < 10) {
- this.deptBudgetList.tranCarInfoList.push({
- driverName: '',
- driverPhone: '',
- carLength: 0,
- carLengthKey: '',
- loadWeight: null,
- carModel: '',
- carModelKey: '',
- carNumber: '',
- disabled: false,
- tranType: '1',
- fleetFlag:0,
- tranPriceCar:this.deptBudgetList.tranPriceCar,
- billingMethod:this.pricetype,
- // tranCarNo: tmp1+(this.deptBudgetList.count),
- tranCarNo: 'C00' + (this.deptBudgetList.tranCarInfoList.length + 1),
- tranPrice: this.deptBudgetList.tranPrice
- })
- } else if (this.deptBudgetList.tranCarInfoList.length < 100 && this.deptBudgetList.tranCarInfoList.length >=
- 10) {
- tmp1 = 'C0'
- this.deptBudgetList.count++
- this.deptBudgetList.tranCarInfoList.push({
- driverName: '',
- driverPhone: '',
- carLength: 0,
- carLengthKey: '',
- loadWeight: null,
- carModel: '',
- carModelKey: '',
- carNumber: '',
- disabled: false,
- fleetFlag:0,
- tranType: '1',
- tranPriceCar:this.deptBudgetList.tranPriceCar,
- billingMethod:this.pricetype,
- // tranCarNo: tmp1+(this.deptBudgetList.count),
- tranCarNo: 'C0' + (this.deptBudgetList.tranCarInfoList.length + 1),
- tranPrice: this.deptBudgetList.tranPrice
- })
- } else if (this.deptBudgetList.tranCarInfoList.length < 1000 && this.deptBudgetList.tranCarInfoList.length >=
- 100) {
- tmp1 = 'C'
- this.deptBudgetList.count++
- this.deptBudgetList.tranCarInfoList.push({
- driverName: '',
- driverPhone: '',
- carLength: 0,
- carLengthKey: '',
- loadWeight: null,
- carModel: '',
- carModelKey: '',
- carNumber: '',
- disabled: false,
- fleetFlag:0,
- tranType: '1',
- billingMethod:this.pricetype,
- tranPriceCar:this.deptBudgetList.tranPriceCar,
- // tranCarNo: tmp1+(this.deptBudgetList.count),
- tranCarNo: 'C' + (this.deptBudgetList.tranCarInfoList.length + 1),
- tranPrice: this.deptBudgetList.tranPrice
- })
- }
- }
- }
-
- },
- //审核
- examine(status) {
- this.$prompt('运输单价审核', {
- cancelButtonText: '取消',
- confirmButtonText: '确定',
- inputValue: status==1?this.deptBudgetList.tranPriceIng:this.deptBudgetList.tranPriceIngCar
- }).then(({
- value
- }) => {
- var tranProcessInfo = {}
- tranProcessInfo.reviewer = localStorage.getItem('ws-pf_roleName') +
- localStorage.getItem('ws-pf_staffName')
- tranProcessInfo.id = this.deptBudgetList.id
- tranProcessInfo.flag = '2'
- tranProcessInfo.tranTypeKey = 1
- tranProcessInfo.billingMethod= this.deptBudgetList.billingMethod
- if(this.deptBudgetList.billingMethod==2){
- tranProcessInfo.tranPriceIngCar=value
- setUpTranPriceCar(tranProcessInfo)
- .toPromise()
- .then((response) => {
- this.$message.success('提交成功')
- this.getList()
- })
- }else{
- tranProcessInfo.tranPriceIng = value
- setUpTranPrice(tranProcessInfo)
- .toPromise()
- .then((response) => {
- this.$message.success('审核成功')
- this.getList()
- });
- }
- }).catch(() => {
- this.$message.warning(
- '取消审核'
- );
- });
- },
- priceSubmit(status) {
- this.$confirm(`运输单价将发送给决策人审核,确定提交?`, {
- cancelButtonText: '取消',
- confirmButtonText: '确定',
- type: 'warning',
- })
- .then(() => {
- var tranProcessInfo = {}
- tranProcessInfo.id = this.deptBudgetList.id
- tranProcessInfo.flag = '1'
- tranProcessInfo.tranTypeKey = 1
- tranProcessInfo.tranPriceIng = this.deptBudgetList.tranPriceIng
- if(!this.deptBudgetList.billingMethod) this.deptBudgetList.billingMethod=1
- tranProcessInfo.billingMethod= this.deptBudgetList.billingMethod
- tranProcessInfo.tranPriceIngCar = this.deptBudgetList.tranPriceIngCar
- if(status==2){
- setUpTranPriceCar(tranProcessInfo)
- .toPromise()
- .then((response) => {
- this.$message.success('提交成功')
- this.getList()
- })
- }else{
- setUpTranPrice(tranProcessInfo)
- .toPromise()
- .then((response) => {
- this.$message.success('提交成功')
- this.getList()
- })
- }
-
- })
- .catch(() => {
- return false
- })
- },
- //提交按钮
- submit() {
- if (!this.deptBudgetList.tranPrice) {
- this.$message({
- message: '请设置运输单价!',
- type: 'warning',
- })
- } else {
- for (var i = this.index; i < this.deptBudgetList.tranCarInfoList.length; i++) {
- if (!this.deptBudgetList.tranCarInfoList[i].driver&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==0) {
- this.$message({
- message: '姓名不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranCarInfoList[i].fleetName&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==1) {
- this.$message({
- message: '车队名称不能为空!',
- type: 'warning',
- })
- return
- }
- 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) {
- this.$message({
- message: '车队名称1-10个字!',
- type: 'warning',
- })
- return
- }
- for (var j = 0; j < this.carList.length; j++) {
- if (this.carList[j].driverName == this.deptBudgetList.tranCarInfoList[i].driver && this.carList[j]
- .disableStatusFlag == 1) {
- this.$message({
- message: this.deptBudgetList.tranCarInfoList[i].driver + '该司机已被禁用!',
- type: 'warning',
- })
- return
- }
- }
- }
- this.$confirm(`提交成功后,任务将下发给司机,是否确定提交?`, {
- cancelButtonText: '取消',
- confirmButtonText: '确定',
- type: 'warning',
- })
- .then(() => {
- this.$refs.deptBudgetList.validate((valid) => {
- if (valid) {
- var tranCarInfo = {}
- tranCarInfo.id = this.deptBudgetList.id
- tranCarInfo.processNo = this.deptBudgetList.processNo
- tranCarInfo.tranPrice = this.deptBudgetList.tranPrice
- tranCarInfo.infoId = this.deptBudgetList.infoId
- tranCarInfo.billingMethod=this.pricetype
- tranCarInfo.tranCarInfoList = this.deptBudgetList.tranCarInfoList
- dispatchCat(tranCarInfo)
- .toPromise()
- .then((response) => {
- this.$message.success('提交成功')
- this.$router.go(-1)
- })
- } else {
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
- return false
- }
- })
- })
- .catch(() => {
- return false
- })
- }
- },
- handleClose() {
- this.accessoryTFs = false
- },
- getList() {
- seeCat({
- id: this.$route.query.id
- })
- .toPromise()
- .then((response) => {
- if (response.tranCarInfoList.length > 0) {
- this.index = response.tranCarInfoList.length
- for (var i = 0; i < response.tranCarInfoList.length; i++) {
- if (response.tranCarInfoList[i].id) {
- response.tranCarInfoList[i].disabled = true
- }
- }
- }
- if(response.billingMethod){
- this.pricetype=response.billingMethod
- }
- this.deptBudgetList = response
- this.fhaddress = response.sendPrivate + response.sendCity + response.sendArea + response
- .sendDetailedAddress
- this.shaddress = response.receivePrivate + response.receiveCity + response.receiveArea + response
- .receiveDetailedAddress
- if (this.deptBudgetList.tranPriceIng == 0) {
- this.deptBudgetList.tranPriceIng = ''
- }
- if (this.deptBudgetList.tranCarInfoList.length == 0) {
- this.deptBudgetList.tranCarInfoList = [{
- driverName: '',
- driverPhone: '',
- carLength: 0,
- carLengthKey: '',
- loadWeight: null,
- carModel: '',
- carModelKey: '',
- carNumber: '',
- disabled: false,
- fleetFlag:0,
- tranType: '1',
- tranCarNo: 'C001',
- billingMethod:1,
- tranPrice: this.deptBudgetList.tranPrice
- }, ]
- }
- })
- nameXiala({
- compId: this.compId
- })
- .toPromise()
- .then((response) => {
- this.carList = response
- })
- },
- carchange(val, index) {
- for (var i = 0; i < this.carList.length; i++) {
- if (this.carList[i].driverName == val) {
- this.deptBudgetList.tranCarInfoList[index].driverPhone =
- this.carList[i].driverPhone
- arrange({
- id: this.carList[i].id
- })
- .toPromise()
- .then((response) => {
- console.log(this, response)
- this.deptBudgetList.tranCarInfoList[index].carNo =
- response.carNumber
- if (response.carLoad != null) {
- this.deptBudgetList.tranCarInfoList[index].loadWeight =
- response.carLoad
- } else {
- this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
- }
- this.deptBudgetList.tranCarInfoList[index].carModel =
- response.carModel
- this.deptBudgetList.tranCarInfoList[index].carLength =
- response.carLength
- this.deptBudgetList.tranCarInfoList[index].carLengthKey =
- response.carLengthKey
- this.deptBudgetList.tranCarInfoList[index].carModelKey =
- response.carModelKey
- })
- }
- }
- },
- phonechange(val, index) {
- for (var i = 0; i < this.carList.length; i++) {
- if (this.carList[i].driverPhone == val) {
- this.deptBudgetList.tranCarInfoList[index].driver =
- this.carList[i].driverName
- arrange({
- id: this.carList[i].id
- })
- .toPromise()
- .then((response) => {
- console.log(this, response)
- this.deptBudgetList.tranCarInfoList[index].carNo =
- response.carNumber
- if (response.carLoad != null) {
- this.deptBudgetList.tranCarInfoList[index].loadWeight =
- response.carLoad
- } else {
- this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
- }
- this.deptBudgetList.tranCarInfoList[index].carModel =
- response.carModel
- this.deptBudgetList.tranCarInfoList[index].carLength =
- response.carLength
- this.deptBudgetList.tranCarInfoList[index].carLengthKey =
- response.carLengthKey
- this.deptBudgetList.tranCarInfoList[index].carModelKey =
- response.carModelKey
- })
- }
- }
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- // /deep/.basicInformation {
- // .ws-info-table {
- // border: none;
- // }
- // .myTest {
- // width: 800px;
- // display: flex;
- // height: 40px;
- // }
- // .el-form-item {
- // width: 33.3333%;
- // border: none;
- // height: 50px;
- // .el-form-item__label {
- // background: transparent;
- // border: none;
- // }
- // .el-form-item__content {
- // border: none;
- // }
- // }
- // }
- // .title {
- // position: relative;
- // padding-left: 10px;
- // }
- // .title::before {
- // content: '';
- // display: inline-block;
- // width: 5px;
- // height: 30px;
- // background: #5473e8;
- // position: absolute;
- // left: 0;
- // }
- // .el-form {
- // padding: 0 10%;
- // }
- // .el-button--primary {
- // background-color: #5878e8;
- // border-color: #5878e8;
- // }
- // .el-col {
- // background: #f6f7fc;
- // }
- // .bg-right {
- // text-align: right;
- // padding: 16px 20px;
- // }
- // .center {
- // margin: 0 auto;
- // width: 70%;
- // }
- //表格文字
- // /deep/.ws-info-table .el-form-item .el-form-item__label {
- // text-align: center;
- // font-size: 14px;
- // font-weight: 400;
- // color: #8890b1;
- // line-height: 16px;
- // }
- // //蓝标
- // .small-title {
- // position: relative;
- // padding: 10px;
- // font-weight: 600;
- // }
- // .small-title::before {
- // position: absolute;
- // content: '';
- // display: block;
- // background: #5473e8;
- // width: 4px;
- // height: 14px;
- // left: 0px;
- // top: 13px;
- // padding: 4px 2px;
- // }
- // .position {
- // position: relative;
- // }
- // .position .zaizhong {
- // width: 16%;
- // }
- // //减号
- // .del {
- // position: absolute;
- // // right: -38px;
- // top: 9px;
- // cursor: pointer;
- // right: 0;
- // display: inline-block;
- // font-size: 20px;
- // width: 20px;
- // height: 10px;
- // line-height: 0px;
- // }
- // .driver .el-form-item {
- // width: 16.63%;
- // }
- // /deep/.ws-info-table .el-form-item .el-form-item__content {
- // background: #f5f7fa;
- // border-radius: 4px;
- // color: #8890b1;
- // font-size: 14px;
- // padding: 0 25px;
- // }
- // /deep/.driver .ws-info-table .el-form-item .el-form-item__label {
- // width: 72px;
- // }
- // /deep/.liaison .ws-info-table .el-form-item {
- // width: 220px;
- // color: #8890b1;
- // font-size: 14px;
- // }
- // /deep/.ws-info-table .el-form-item {
- // border: none;
- // height: 50px;
- // }
- // /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
- // width: 50%;
- // border: 0px solid #d8dce6;
- // background: #f5f7fa;
- // text-align: center;
- // }
- // /deep/.liaison {
- // background: #f5f7fa;
- // border-radius: 4px;
- // border: 0px solid #d8dce6;
- // }
- // /deep/.liaison .ws-info-table .el-form-item .el-form-item__content {
- // border: none;
- // background: #f5f7fa;
- // padding: 0px;
- // }
- // .catNos {
- // width: 100%;
- // height: 30px;
- // margin-top: 10px;
- // margin-left: 20px;
- // font-size: 14px;
- // }
- // /deep/.liaison .ws-info-table .el-form-item .el-form-item__content {
- // border-radius: 0px;
- // border-left: none;
- // border-bottom: none;
- // border-top: none;
- // }
- // /deep/.liaison .ws-info-table {
- // background: #f6f7fc;
- // border-radius: 4px;
- // border: 1px solid #d8dce6;
- // margin-top: 20px;
- // }
- //送达/未送达
- // .noservice,
- // .service {
- // display: inline-block;
- // border-radius: 4px;
- // border: 1px solid #d8dce6;
- // padding: 2px;
- // font-size: 12px;
- // }
- // .noservice {
- // background: #c4cada;
- // color: #ffffff;
- // }
- // .service {
- // background: #e5f1f7;
- // color: #50cad4;
- // }
- // .serviced {
- // display: inline-block;
- // border-radius: 4px;
- // border: 1px solid #d8dce6;
- // padding: 2px;
- // font-size: 12px;
- // background: #e5f1f7;
- // color: #2c81cf;
- // }
- // //添加司机
- // .add {
- // width: 100px;
- // height: 34px;
- // background: #f6f7fb;
- // border-radius: 17px;
- // color: #5473e8;
- // font-size: 14px;
- // border: none;
- // }
- // .add img {
- // display: inline-block;
- // margin-top: 3px;
- // margin-left: -12px;
- // }
- // .add .spans {
- // display: table-caption;
- // width: 56px;
- // height: 20px;
- // line-height: 18px;
- // }
- /deep/.el-form-item--small.el-form-item {
- margin-bottom: 0px
- }
- .input-item-margin {
- margin-right: 20px;
- }
- .row-item {
- width: 100%;
- }
- .bg-right {
- text-align: right;
- padding: 16px 20px;
- }
- .center {
- margin: 0 auto;
- width: 70%;
- }
- //蓝标
- .small-title {
- position: relative;
- padding: 10px;
- font-weight: 600;
- }
- //小标题文字
- .small-title::before {
- position: absolute;
- content: '';
- display: block;
- background: #5473e8;
- width: 4px;
- height: 14px;
- left: 0px;
- top: 16px;
- padding: 4px 2px;
- }
- .bg-left {
- padding-left: 30px;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- }
- .myTest {
- display: flex;
- margin-bottom: 20px;
- // background: green;
- padding-left: 20px;
- align-items: center;
- width: 800px;
- }
- .myTest .el-form-item {
- width: 33.333%;
- }
- .content3 ,.contentitem{
- width: calc(100% + 20px);
- .content3-item1 {
- position: relative;
- background: #F5F7FA;
- border: 1px solid #E4E7ED;
- border-radius: 5px;
- height: 200px;
- width: 100%;
- padding: 10px 20px 0 0;
- margin-top: 20px;
- }
- }
- .contentitem{
- .content3-item1 {
- height: 90px;
- }
- }
- .content4 {
- background: #F5F7FA;
- display: flex;
- margin: 10px 0;
- border: 1px solid #E4E7ED;
- border-radius: 5px;
- position: relative;
- }
- .del {
- position: absolute;
- right: 4px;
- top: 0px;
- cursor: pointer;
- font-size: 20px;
- width: 16px;
- height: 10px;
- }
- </style>
|