1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315 |
- // 编辑运输任务
- <template>
- <div class="container">
- <el-row>
- <el-col :span="12">
- <h2 class="bg-left title">编辑运输任务</h2>
- </el-col>
- <el-col :span="12" class="bg-right">
- <el-button
- class="bg-bottom"
- type="primary"
- size="small"
- @click="returnsales()"
- ><img
- width="6"
- height="10"
- style="vertical-align: bottom; margin-right: 3px"
- src="../../../public/img/lujing.png"
- alt=""
- />返回</el-button
- >
- </el-col>
- </el-row>
- <el-form
- ref="deptBudgetList"
- :rules="mainReportAdd"
- :model="deptBudgetList"
- >
- <ws-info-table class="el-table">
- <el-form-item label="任务编号" span="1" prop="taskNo" class="forlist">
- <el-input
- v-model="deptBudgetList.taskNo"
- placeholder="请输入任务编号"
- maxlength="20"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item prop="taskType" label="任务类型" span="1">
- <el-select
- v-model="deptBudgetList.taskType"
- placeholder="请输入任务类型"
- @change="selecttaskType"
- >
- <el-option
- v-for="item in taskType"
- :key="item.constKey"
- :label="item.constValue"
- :value="item.constValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="contractNo" label="合同编号/移库任务编号" span="1">
- <el-select
- v-model="deptBudgetList.contractNo"
- placeholder="请选择编号"
- @change=" (val) => {
- selectcontractNo(val)
- }"
- >
- <el-option
- v-for="item in contractNoList"
- :key="item.constKey"
- :label="item.contractNo"
- :value="item.contractNo"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="goodsName" label="货名" span="1">
- <el-input
- disabled
- v-model="deptBudgetList.goodsName"
- placeholder="请输入货名"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="重量(吨)" span="1" prop="weight">
- <el-input
- @input="weightchange"
- v-model="deptBudgetList.weight"
- placeholder="请输入重量"
- maxlength="20"
- size="small"
- ></el-input>
- </el-form-item>
- </ws-info-table>
- <ws-info-table class="el-table">
- <div class="start-address" style="width: 36%">
- <el-radio-group
- @change="warehouseTypechange"
- v-model="deptBudgetList.warehouseType"
- >
- <el-radio label="1">常用仓库发货</el-radio>
- <el-radio label="2">临时仓库发货</el-radio>
- </el-radio-group>
- <el-select
- v-model="deptBudgetList.sendWarehouse"
- placeholder="选择仓库"
- class="typeselect"
- @change="sendWarehousechange"
- >
- <el-option
- v-for="item in warehouseList"
- :key="item.constKey"
- :label="item.warehouseName"
- :value="item.warehouseName"
- ></el-option>
- </el-select>
- </div>
-
- <el-form-item label="始发地" span="1" class="start-address">
- <el-cascader
- :options="options_"
- v-model="selectedOptions"
- clearable
- size="large"
- placeholder="请选择始发地"
- @change="handleChange"
- />
- </el-form-item>
- <el-form-item
- label="始发地详细地址"
- span="1"
- prop="startDetailedAddress"
- class="bg-right start-address"
- >
- <el-input
- v-model="deptBudgetList.startDetailedAddress"
- placeholder="请输入始发地详细地址"
- maxlength="20"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item
- label="收货库点"
- span="1"
- prop="contractNo"
- class="start-address"
- style="width: 36%"
- >
- <el-select
- @change="sendWarehousechange1"
- v-model="deptBudgetList.receiveWarehouse"
- :disabled="warehouse"
- placeholder="请输入收货库点"
- style="width: 100%"
- >
- <el-option
- v-for="item in warehouseList"
- :key="item.constKey"
- :label="item.warehouseName"
- :value="item.warehouseName"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- label="终到地"
- span="1"
- prop="contractNo"
- class="start-address"
- >
- <el-cascader
- :options="options_"
- v-model="selectedOptions1"
- clearable
- size="large"
- placeholder="请选择终到地"
- @change="handleChange1"
- />
- </el-form-item>
- <el-form-item
- label="终到地详细地址"
- span="1"
- prop="endDetailedAddress"
- class="bg-right start-address"
- >
- <el-input
- v-model="deptBudgetList.endDetailedAddress"
- placeholder="请输入终到地详细地址"
- maxlength="20"
- size="small"
- @change="endDetailedAddressChange"
- ></el-input>
- </el-form-item>
- <div class="check-box">
- <span class="check-box">运输方式</span>
- <el-checkbox-group v-model="checkList" prop="tranType">
- <el-checkbox label="汽运" checked></el-checkbox>
- <el-checkbox label="火运"></el-checkbox>
- <el-checkbox label="船运"></el-checkbox>
- </el-checkbox-group>
- </div>
- </ws-info-table>
- <div
- style="width: 100%"
- class="position"
- v-for="(item, index) in deptBudgetList.tranProcessInfoList"
- :key="index"
- >
- <div class="driver">
- <span style="vertical-align: top"
- >运输阶段{{ index + 1 }} {{ item.processNo }}</span
- >
- <!-- 暂时取消添加运输阶段 -->
- <!-- <img
- width="22"
- height="22"
- class="add"
- @click="add(index)"
- src="../../../public/img/add.png"
- alt=""
- />
- <img
- width="22"
- height="22"
- class="del"
- @click="del(index, item)"
- v-if="item.carNum==0||!item.carNum"
- src="../../../public/img/del.png"
- alt=""
- /> -->
- <!-- <el-checkbox
- @change="(val) => {engflagchange(val, index)}"
- class="endflag"
- :disabled='disabled'
- true-label="1"
- false-label="0"
- v-model="item.endFlag"
- :label="1"
- >粮款结算阶段</el-checkbox
- > -->
- </div>
- <ws-info-table>
- <el-form-item label="运输方式" span="1" prop="waterContent">
- <el-select
- v-model="item.tranType"
- placeholder="运输方式"
- @change="
- (val) => {
- selecttaskwayList(val, index)
- }
- "
- >
- <el-option
- v-for="item in taskwayList"
- :key="item.constKey"
- :label="item.constValue"
- :value="item.constValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="发货日期" span="1" prop="impurity">
- <ws-date-picker
- v-model="item.deliveryDateStart"
- type="date"
- placeholder="请选择发货日期"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- <el-form-item label="最晚到货日期" span="1" prop="bulkDensity">
- <ws-date-picker
- v-model="item.deliveryDateEnd"
- type="date"
- placeholder="请选择最晚到货日期"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- <el-form-item
- label="本阶段运输重量(吨)"
- span="1"
- prop="bulkDensity"
- >
- <el-input
- v-model="item.weight"
- placeholder="请输入本阶段运输重量"
- size="small"
- ></el-input>
- </el-form-item>
- </ws-info-table>
- <ws-info-table>
- <el-form-item label="发货地区" span="1" prop="waterContent">
- <el-cascader
- :options="options_"
- v-model="item.selectedOptions"
- clearable
- size="large"
- placeholder="请选择发货地区"
- style="width: 200%"
- @change="
- (val) => {
- handleChange3(val, index)
- }
- "
- />
- </el-form-item>
- <el-form-item label="发货地详细地址" span="1" prop="impurity">
- <el-input
- v-model="item.sendDetailedAddress"
- placeholder="请输入发货地详细地址"
- maxlength="20"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="发货人" span="1" prop="bulkDensity">
- <el-select
- v-model="item.sender"
- placeholder="请选择发货人"
- filterable
-
- @change="(val) => {
- selectstaff(val, index)
- }"
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.staffName"
- :value="item.staffName"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="发货人电话" span="1" prop="bulkDensity">
- <el-input
- v-model="item.senderPhone"
- placeholder="请输入发货人电话"
- maxlength="20"
- size="small"
- disabled
- ></el-input>
- </el-form-item>
- </ws-info-table>
- <ws-info-table>
- <el-form-item label="收货地区" span="1" prop="bulkDensity">
- <el-cascader
- :options="options_"
- v-model="item.selectedOptions1"
- clearable
- size="large"
- placeholder="请选择收货地区"
- style="width: 200%"
- @change="
- (val) => {
- handleChange4(val, index)
- }
- "
- />
- </el-form-item>
- <el-form-item label="收货地详细地址" span="1" prop="impurity">
- <el-input
- v-model="item.receiveDetailedAddress"
- placeholder="请输入收货地详细地址"
- maxlength="20"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item label="收货人" span="1" prop="bulkDensity">
- <el-select
- v-model="item.receiver"
- placeholder="请选择收货人"
- filterable
-
- @change="(val) => {
- selectstaff1(val, index)
- }"
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.staffName"
- :value="item.staffName"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="收货人电话" span="1" prop="bulkDensity">
- <el-input
- v-model="item.receiverPhone"
- placeholder="请输入收货人电话"
- maxlength="20"
- size="small"
- disabled
- ></el-input>
- </el-form-item>
- </ws-info-table>
- </div>
- </el-form>
- <!-- 提交 -->
- <div style="text-align: right; padding: 10px" class="center">
- <el-button
- class="bg-bottom"
- type="primary"
- size="small"
- @click="submit(deptBudgetList)"
- >提交</el-button
- >
- </div>
- </div>
- </template>
- <script>
- import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
- import { packList } from '@/model/contarct/index'
- import {
- edittran,
- getwarehousename,
- xialaNo,
- examinetran,
- delhaulagestage,
-
- getstaff
- } from '@/model/tasksport/index'
- import WsUpload from '@/components/WsUpload'
- import mapDrag from '@/components/mapdrag/mapdrag'
- export default {
- name: 'viewSpareMoney',
- components: {
- WsUpload,
- mapDrag,
- },
- watch: {
- vesselId(val) {
- this.getVesselData()
- },
- isShow(val) {
- this.showType = val
- },
- },
- data() {
- let self = this
- return {
- checkList: [],
- deptBudgetList: {},
- radio: '1',
- carModelList: [],
- carLengthList: [],
- disabled:false,
- warehouseType: '1',
- options_: regionData,
- heightData: '600px',
- selectedOptions: [],
- selectedOptions1: [],
- compId: localStorage.getItem('ws-pf_compId'),
- mainReportAdd: {},
- warehouseList: [],
- warehouseList1:[],
- goodnameList: [],
- options: [],
- taskType: [],
- size: 10,
- unitList: [],
- contractNoList: [],
- taskwayList: [],
- name: '',
- age: '',
- weight: 0,
- number: 2,
- count: 2,
- }
- },
- activated() {
- this.loaddata()
- this.showType = this.isShow
- },
- computed: {
- warehouse: function () {
- if (
- this.deptBudgetList.taskType == '销售出库' ||
- this.deptBudgetList.taskType == '贸易服务出库' ||
- this.deptBudgetList.taskType == '暂存出库'
- ) {
- return true
- } else {
- return false
- }
- },
- },
- methods: {
- sendWarehousechange(e) {
- for (let i = 0; i < this.warehouseList.length; i++) {
- if (this.warehouseList[i].warehouseName == e) {
- var tmp = []
- tmp[0] = TextToCode[this.warehouseList[i].warehousePrivate].code
- tmp[1] =
- TextToCode[this.warehouseList[i].warehousePrivate][
- this.warehouseList[i].warehouseCity
- ].code
- tmp[2] =
- TextToCode[this.warehouseList[i].warehousePrivate][
- this.warehouseList[i].warehouseCity
- ][this.warehouseList[i].warehouseArea].code
- this.selectedOptions = tmp
- this.deptBudgetList.tranProcessInfoList[0].selectedOptions = tmp
- this.$set(
- this.deptBudgetList,
- 'startDetailedAddress',
- this.warehouseList[i].detailedAddress
- )
- this.$set(
- this.deptBudgetList.tranProcessInfoList[0],
- 'sendDetailedAddress',
- this.deptBudgetList.startDetailedAddress
- )
- }
- }
- },
- selectcontractNo(val) {
- for (var i = 0; i < this.contractNoList.length; i++) {
- if (this.contractNoList[i].contractNo == val) {
- this.deptBudgetList.goodsName = this.contractNoList[i].goodsName
- this.deptBudgetList.weight= this.contractNoList[i].weight
- }
- }
- },
- sendWarehousechange1(e){
- for (let i = 0; i < this.warehouseList1.length; i++) {
- if (this.warehouseList1[i].warehouseName == e) {
- var tmp = []
- tmp[0] = TextToCode[this.warehouseList1[i].warehousePrivate].code
- tmp[1] =
- TextToCode[this.warehouseList1[i].warehousePrivate][
- this.warehouseList1[i].warehouseCity
- ].code
- tmp[2] =
- TextToCode[this.warehouseList1[i].warehousePrivate][
- this.warehouseList1[i].warehouseCity
- ][this.warehouseList1[i].warehouseArea].code
- this.selectedOptions1 = tmp
- this.$set(
- this.deptBudgetList,
- 'endDetailedAddress',
- this.warehouseList1[i].detailedAddress
- )
- //终到地 终到地详细地址 默认第一运输阶段的收货地区(需求)
- this.handleChange1(tmp)
- this.endDetailedAddressChange()
- }
- }
- },
- warehouseTypechange() {
- getwarehousename({
- compId: this.compId,
- warehouseType: this.deptBudgetList.warehouseType,
- })
- .toPromise()
- .then((response) => {
- this.warehouseList = response
- })
- },
- weightchange(e) {
- this.deptBudgetList.tranProcessInfoList[0].weight = e
- },
- selectstaff(val, index) {
- for (var i = 0; i < this.staffList.length; i++) {
- if (this.staffList[i].staffName == val) {
- this.deptBudgetList.tranProcessInfoList[index].senderPhone = this.staffList[i].staffMobilePhone
- }
- }
- },
- selectstaff1(val, index) {
- for (var i = 0; i < this.staffList.length; i++) {
- if (this.staffList[i].staffName == val) {
- this.deptBudgetList.tranProcessInfoList[index].receiverPhone = this.staffList[i].staffMobilePhone
- }
- }
- },
- dataFilter(val) {
- this.deptBudgetList.personCharge = val
- if (val) {
- console.log(val)
- this.options = this.staffList.filter((item) => {
- if (
- !!~item.staffName.indexOf(val) ||
- !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
- ) {
- return true
- }
- })
- } else {
- this.options = this.staffList
- }
- },
- engflagchange(e,index) {
- this.$confirm('选择结算阶段后不可修改,是否确定选择?', {
- distinguishCancelAndClose: true,
- confirmButtonText: '确定',
- cancelButtonText: '取消'
- })
- .then(() => {
- this.$message({
- type: 'success',
- message: '选择成功'
- });
- this.disabled=true
- })
- .catch(action => {
- });
- for(var i=0;i<this.deptBudgetList.tranProcessInfoList.length;i++){
- this.deptBudgetList.tranProcessInfoList[i].endFlag='0'
- }
- this.deptBudgetList.tranProcessInfoList[index].endFlag = e
- // if (this.endflag) {
- // this.deptBudgetList.tranProcessInfoList[
- // this.deptBudgetList.tranProcessInfoList.length - 1
- // ].selectedOptions1 = this.selectedOptions1
- // this.deptBudgetList.tranProcessInfoList[
- // this.deptBudgetList.tranProcessInfoList.length - 1
- // ].receiveDetailedAddress = this.deptBudgetList.endDetailedAddress
- // } else {
- // this.deptBudgetList.tranProcessInfoList[
- // this.deptBudgetList.tranProcessInfoList.length - 1
- // ].selectedOptions1 = []
- // this.deptBudgetList.tranProcessInfoList[
- // this.deptBudgetList.tranProcessInfoList.length - 1
- // ].receiveDetailedAddress = ''
- // }
- },
- loaddata() {
- examinetran({ id: this.$route.query.id })
- .toPromise()
- .then((response) => {
- // for (var j = 0; j < response.tranProcessInfoList.length; j++) {
- // if (response.tranProcessInfoList[j].endFlag == '1') {
- // this.endflag = '1'
- // }
- // }
-
- this.deptBudgetList = response
- if(this.deptBudgetList.tranProcessInfoList.some( function( item, index, array ){
- return item.endFlag==1
- })){
- this.disabled=true
- }
- this.number = response.tranProcessInfoList.length + 1
- this.count = response.count + 1
- if (
- response.startPrivate != null &&
- response.startCity != null &&
- response.startArea != null
- ) {
- var tmp = []
- tmp[0] = TextToCode[response.startPrivate].code
- tmp[1] = TextToCode[response.startPrivate][response.startCity].code
- tmp[2] =
- TextToCode[response.startPrivate][response.startCity][
- response.startArea
- ].code
- this.selectedOptions = tmp
- }
- if (
- response.endPrivate != null &&
- response.endCity != null &&
- response.endArea != null
- ) {
- var tmp1 = []
- tmp1[0] = TextToCode[response.endPrivate].code
- tmp1[1] = TextToCode[response.endPrivate][response.endCity].code
- tmp1[2] =
- TextToCode[response.endPrivate][response.endCity][
- response.endArea
- ].code
- this.selectedOptions1 = tmp1
- }
- for (var i = 0; i < response.tranProcessInfoList.length; i++) {
- // console.log(response.tranProcessInfoList[i].endFlag)
- if (
- response.tranProcessInfoList[i].sendPrivate != '' &&
- response.tranProcessInfoList[i].sendCity != '' &&
- response.tranProcessInfoList[i].sendArea != ''
- ) {
- var tmp2 = []
- tmp2[0] =
- TextToCode[response.tranProcessInfoList[i].sendPrivate].code
- tmp2[1] =
- TextToCode[response.tranProcessInfoList[i].sendPrivate][
- response.tranProcessInfoList[i].sendCity
- ].code
- tmp2[2] =
- TextToCode[response.tranProcessInfoList[i].sendPrivate][
- response.tranProcessInfoList[i].sendCity
- ][response.tranProcessInfoList[i].sendArea].code
- response.tranProcessInfoList[i].selectedOptions = tmp2
- }
- if (
- response.tranProcessInfoList[i].receivePrivate != '' &&
- response.tranProcessInfoList[i].receiveCity != '' &&
- response.tranProcessInfoList[i].receiveArea != ''
- ) {
- var tmp3 = []
- tmp3[0] =
- TextToCode[response.tranProcessInfoList[i].receivePrivate].code
- tmp3[1] =
- TextToCode[response.tranProcessInfoList[i].receivePrivate][
- response.tranProcessInfoList[i].receiveCity
- ].code
- tmp3[2] =
- TextToCode[response.tranProcessInfoList[i].receivePrivate][
- response.tranProcessInfoList[i].receiveCity
- ][response.tranProcessInfoList[i].receiveArea].code
- response.tranProcessInfoList[i].selectedOptions1 = tmp3
- }
- this.weight = response.weight
- }
- this.checkList = response.tranType.split(',')
- })
- // 货名
- packList({ constId: 'CON2' })
- .toPromise()
- .then((response) => {
- this.goodnameList = response
- })
- // 任务类型
- packList({ constId: 'TRAN3' })
- .toPromise()
- .then((response) => {
- this.taskType = response
- })
- // 运输方式
- packList({ constId: 'TRAN6' })
- .toPromise()
- .then((response) => {
- this.taskwayList = response
- })
- getstaff({ compId: localStorage.getItem('ws-pf_compId') })
- .toPromise()
- .then((response) => {
- // this.agent = response
- this.options = response
- this.staffList = response
- this.sender = response
- })
- getwarehousename({
- compId: this.compId,
- warehouseType: this.deptBudgetList.warehouseType,
- })
- .toPromise()
- .then((response) => {
- this.warehouseList = response
- })
- getwarehousename({
- compId: this.compId,
- warehouseType: 1,
- })
- .toPromise()
- .then((response) => {
- this.warehouseList1 = response
- })
- xialaNo({
- compId: this.compId,
- })
- .toPromise()
- .then((response) => {
- this.contractNoList = response
- })
- },
- selecttaskType(e) {
- for (var i = 0; i < this.taskType.length; i++) {
- if (this.taskType[i].constValue == e) {
- this.deptBudgetList.taskTypeKey = this.taskType[i].constKey
- }
- }
- },
- selecttaskwayList(e, index) {
- for (var i = 0; i < this.taskwayList.length; i++) {
- if (this.taskwayList[i].constValue == e) {
- this.deptBudgetList.tranProcessInfoList[index].tranTypeKey =
- this.taskwayList[i].constKey
- }
- }
- },
- selectgoodsname(e) {
- for (var i = 0; i < this.goodnameList.length; i++) {
- if (this.goodnameList[i].constValue == e) {
- this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
- }
- }
- },
- // 关闭 dialog时 处理文件url 初始化upload组件
- handleClose() {
- this.dialogViewSpareMoney = false
- },
- add(index) {
- this.deptBudgetList.tranProcessInfoList.push({
- processNo: this.deptBudgetList.taskNo + this.count,
- sort: 0,
- tranType: '汽运',
- tranTypeKey: '1',
- deliveryDateStart: '',
- deliveryDateEnd: '',
- weight: this.weight,
- selectedOptions: [],
- selectedOptions1: [],
- sendPrivate: '',
- sendCity: '',
- sendArea: '',
- receivePrivate: '',
- receiveCity: '',
- receiveArea: '',
- sendDetailedAddress: '',
- receiveDetailedAddress: '',
- sender: '',
- endFlag:'0',
- receiver: '',
- senderPhone: '',
- receiverPhone: '',
- })
- this.count++
- },
- del(index, row) {
- if (row.id) {
- this.$confirm('任务阶段删除后不可恢复,是否确定删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- }).then(() => {
- delhaulagestage({ id: row.id })
- .toPromise()
- .then((response) => {
- this.$message.success('删除成功')
- if (this.deptBudgetList.tranProcessInfoList.length > 1) {
- this.deptBudgetList.tranProcessInfoList.splice(index, 1)
- }
- })
- })
- } else {
- if (this.deptBudgetList.tranProcessInfoList.length > 1) {
- this.deptBudgetList.tranProcessInfoList.splice(index, 1)
- }
- }
- this.count--
- this.loaddata()
- },
- handleChange(value) {
- this.selectedOptions = value
- this.deptBudgetList.startPrivate = CodeToText[value[0]]
- this.deptBudgetList.startCity = CodeToText[value[1]]
- this.deptBudgetList.startArea = CodeToText[value[2]]
- },
- handleChange1(value) {
- this.selectedOptions1 = value
- this.deptBudgetList.endPrivate = CodeToText[value[0]]
- this.deptBudgetList.endCity = CodeToText[value[1]]
- this.deptBudgetList.endArea = CodeToText[value[2]]
- //终到地 默认第一运输阶段的收货地区(需求)
- this.deptBudgetList.tranProcessInfoList[0].selectedOptions1 = value
- this.deptBudgetList.tranProcessInfoList[0].receivePrivate = CodeToText[value[0]]
- this.deptBudgetList.tranProcessInfoList[0].receiveCity = CodeToText[value[1]]
- this.deptBudgetList.tranProcessInfoList[0].receiveArea = CodeToText[value[2]]
- },
- // 终到地详细地址改变事件
- endDetailedAddressChange(){
- //终到地详细地址 默认第一运输阶段的收货地详细地址(需求)
- this.deptBudgetList.tranProcessInfoList[0].receiveDetailedAddress = this.deptBudgetList.endDetailedAddress
- },
- handleChange3(value, index) {
- this.deptBudgetList.tranProcessInfoList[index].sendPrivate =
- CodeToText[value[0]]
- this.deptBudgetList.tranProcessInfoList[index].sendCity =
- CodeToText[value[1]]
- this.deptBudgetList.tranProcessInfoList[index].sendArea =
- CodeToText[value[2]]
- },
- handleChange4(value, index) {
- this.deptBudgetList.tranProcessInfoList[index].receivePrivate =
- CodeToText[value[0]]
- this.deptBudgetList.tranProcessInfoList[index].receiveCity =
- CodeToText[value[1]]
- this.deptBudgetList.tranProcessInfoList[index].receiveArea =
- CodeToText[value[2]]
- },
- returnsales() {
- this.$router.push({ path: 'tranManagementTransport' })
- },
- submit() {
- if (!this.deptBudgetList.taskNo) {
- this.$message({
- message: '任务编号不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.taskType) {
- this.$message({
- message: '任务类型不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.contractNo) {
- this.$message({
- message: '合同编号/移库任务编号不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.goodsName) {
- this.$message({
- message: '货名不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.weight) {
- this.$message({
- message: '重量(吨)不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.sendWarehouse) {
- this.$message({
- message: '发货仓库不能为空!',
- type: 'warning',
- })
- return
- }
- if (this.selectedOptions.length <= 0) {
- this.$message({
- message: '始发地不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.startDetailedAddress) {
- this.$message({
- message: '始发地详细地址不能为空!',
- type: 'warning',
- })
- return
- }
- if (this.selectedOptions1.length <= 0) {
- this.$message({
- message: '终到地不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.endDetailedAddress) {
- this.$message({
- message: '终到地详细地址不能为空!',
- type: 'warning',
- })
- return
- }
- if (this.checkList.length <= 0) {
- this.$message({
- message: '运输方式多选框不能为空!',
- type: 'warning',
- })
- return
- }
- for (var i = 0; i < this.deptBudgetList.tranProcessInfoList.length; i++) {
- // this.deptBudgetList.tranProcessInfoList[i].processNo =
- // this.deptBudgetList.taskNo + (i + 1)
- if (
- new Date(
- this.deptBudgetList.tranProcessInfoList[i].deliveryDateStart
- ).getTime() >
- new Date(
- this.deptBudgetList.tranProcessInfoList[i].deliveryDateEnd
- ).getTime()
- ) {
- this.$message({
- message: '发货日期不能大于最晚到货日期!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].deliveryDateStart) {
- this.$message({
- message: '发货日期不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].deliveryDateEnd) {
- this.$message({
- message: '最晚到货日期不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].weight) {
- this.$message({
- message: '重量不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].sender) {
- this.$message({
- message: '发货人不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].senderPhone) {
- this.$message({
- message: '发货人电话不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].receiver) {
- this.$message({
- message: '收货人不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].receiverPhone) {
- this.$message({
- message: '收货人电话不能为空!',
- type: 'warning',
- })
- return
- }
- if (
- !this.deptBudgetList.tranProcessInfoList[i].receiveDetailedAddress
- ) {
- this.$message({
- message: '收获详细地址不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].sendDetailedAddress) {
- this.$message({
- message: '发货详细地址不能为空!',
- type: 'warning',
- })
- return
- }
- }
- // if (this.endFlag == false) {
- // this.$confirm('您还未选择最终阶段,是否确定提交?', '提示', {
- // confirmButtonText: '确定',
- // cancelButtonText: '取消',
- // type: 'warning',
- // })
- // .then(() => {
- // this.$refs.deptBudgetList.validate((valid) => {
- // if (valid) {
- // this.deptBudgetList.compId =
- // localStorage.getItem('ws-pf_compId')
- // this.deptBudgetList.tranType = this.checkList.toString()
- // this.deptBudgetList.startPrivate =
- // CodeToText[this.selectedOptions[0]]
- // this.deptBudgetList.startCity =
- // CodeToText[this.selectedOptions[1]]
- // this.deptBudgetList.startArea =
- // CodeToText[this.selectedOptions[2]]
- // this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
- // CodeToText[this.selectedOptions[0]]
- // this.deptBudgetList.tranProcessInfoList[0].sendCity =
- // CodeToText[this.selectedOptions[1]]
- // this.deptBudgetList.tranProcessInfoList[0].sendArea =
- // CodeToText[this.selectedOptions[2]]
- // for (
- // var i = 0;
- // i < this.deptBudgetList.tranProcessInfoList.length;
- // i++
- // ) {
- // this.deptBudgetList.tranProcessInfoList[i].sort = i
- // }
- // edittran(this.deptBudgetList)
- // .toPromise()
- // .then((response) => {
- // this.$message.success('编辑成功')
- // this.deptBudgetList = {}
- // this.$router.push({ path: 'tranManagementTransport' })
- // })
- // } else {
- // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
- // return false
- // }
- // })
- // })
- // .catch(() => {
- // return false
- // })
- // } else {
- this.$confirm(
- '运输任务提交成功后将派发到物流部门,是否确定提交?',
- '提示',
- {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- this.$refs.deptBudgetList.validate((valid) => {
- if (valid) {
- this.deptBudgetList.compId =
- localStorage.getItem('ws-pf_compId')
- this.deptBudgetList.tranType = this.checkList.toString()
- this.deptBudgetList.startPrivate =
- CodeToText[this.selectedOptions[0]]
- this.deptBudgetList.startCity =
- CodeToText[this.selectedOptions[1]]
- this.deptBudgetList.startArea =
- CodeToText[this.selectedOptions[2]]
- this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
- CodeToText[this.selectedOptions[0]]
- this.deptBudgetList.tranProcessInfoList[0].sendCity =
- CodeToText[this.selectedOptions[1]]
- this.deptBudgetList.tranProcessInfoList[0].sendArea =
- CodeToText[this.selectedOptions[2]]
- this.deptBudgetList.tranProcessInfoList[
- this.deptBudgetList.tranProcessInfoList.length - 1
- ].receivePrivate = CodeToText[this.selectedOptions1[0]]
- this.deptBudgetList.tranProcessInfoList[
- this.deptBudgetList.tranProcessInfoList.length - 1
- ].receiveCity = CodeToText[this.selectedOptions1[1]]
- this.deptBudgetList.tranProcessInfoList[
- this.deptBudgetList.tranProcessInfoList.length - 1
- ].receiveArea = CodeToText[this.selectedOptions1[2]]
- for (
- var i = 0;
- i < this.deptBudgetList.tranProcessInfoList.length;
- i++
- ) {
- this.deptBudgetList.tranProcessInfoList[i].sort = i
- }
- edittran(this.deptBudgetList)
- .toPromise()
- .then((response) => {
- this.$message.success('编辑成功')
- this.deptBudgetList = {}
- this.$router.push({ path: 'tranManagementTransport' })
- })
- } else {
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
- alert('失败1')
- return false
- }
- })
- })
- .catch(() => {
- alert('失败2')
- return false
- })
- // }
- },
- resetForm(deptBudgetList) {
- this.$refs[deptBudgetList].resetFields()
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .position {
- position: relative;
- border-radius: 5px;
- border: 1px solid #5473e8;
- margin-top: 20px;
- background: #f6f7fc;
- border-left: 5px solid #5473e8;
- }
- .position .ws-info-table .el-form-item {
- width: 25%;
- }
- .typeselect {
- width: 30%;
- margin-left: 32px;
- }
- /deep/.position .ws-info-table .el-form-item .el-form-item__label,
- /deep/.position .ws-info-table .el-form-item .el-form-item__content {
- background: #f6f7fc;
- }
- /deep/.position .el-select {
- width: 100%;
- }
- .del,
- .add {
- cursor: pointer;
- margin-left: 10px;
- }
- .el-checkbox-group {
- font-size: 0;
- float: right;
- margin-left: 24px;
- color: #8890b1;
- }
- /deep/.el-checkbox__label {
- color: #8890b1;
- }
- .el-form-item.start-address.el-form-item--small {
- width: 31.9%;
- }
- .check-box {
- margin-top: 10px;
- margin-left: 16px;
- color: #8890b1;
- font-size: 14px;
- }
- /deep/.el-table--border:after,
- /deep/.el-table--group:after,
- /deep/.el-table:before {
- background: transparent;
- }
- .el-form {
- padding: 0 10%;
- }
- .ws-info-table {
- border: none;
- }
- /deep/.ws-info-table .el-form-item {
- border: none;
- height: 50px;
- }
- .readonly {
- position: relative;
- }
- .title {
- position: relative;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- }
- //去边框
- /deep/.el-form-item {
- border-right: 0px;
- border-bottom: 0px;
- }
- .el-form {
- margin-top: 50px;
- }
- .el-col {
- background: #f6f7fc;
- }
- .bg-left {
- padding-left: 30px;
- }
- .bg-right {
- padding-right: 10px;
- text-align: right;
- }
- .bg-bottom {
- margin: 15px 0px;
- background: #5473e8;
- }
- .el-radio,
- .el-radio__input {
- margin-top: 11px;
- margin-left: 11px;
- width: 93px;
- }
- /deep/.ws-info-table .el-form-item {
- width: 20%;
- }
- /deep/.nei {
- .ws-info-table {
- border: none;
- }
- .el-form-item {
- width: 33.3333%;
- border: none;
- .el-form-item__label {
- background: transparent;
- border: none;
- }
- .el-form-item__content {
- border: none;
- }
- }
- }
- /deep/.ws-info-table .el-form-item .el-form-item__label {
- background: #fff;
- text-align: center;
- color: #8890b1;
- font-size: 14px;
- width: -webkit-min-content;
- }
- /deep/.ws-info-table .el-form-item .el-form-item__content {
- border: none;
- }
- .start-address {
- width: 33.333%;
- }
- /deep/.start-address .ws-info-table .el-form-item .el-form-item__content {
- width: 100%;
- color: #8890b1;
- font-size: 14px;
- }
- .driver {
- height: 30px;
- margin-left: 20px;
- margin-top: 10px;
- line-height: 30px;
- font-size: 16px;
- color: #5473e8;
- }
- .el-form {
- height: 73vh;
- overflow: scroll;
- }
- .el-cascader {
- width: 100%;
- }
- </style>
|