12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445 |
- // 创建运输任务
- <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"
- disabled
- ></el-input>
- </el-form-item>
- <el-form-item style="width: 18%" prop="taskType" label="任务类型" span="1">
- <el-select
- v-model="deptBudgetList.taskType"
- placeholder="请输入任务类型"
- @change="selecttaskType"
- filterable clearable
- >
- <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" class='contractNoselect'>
- <el-select
-
- v-model="deptBudgetList.contractNo"
- placeholder="请选择编号"
- @change=" (val) => {
- selectcontractNo(val)
- }"
- filterable clearable
- >
- <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 style="width: 18%" prop="goodsName" label="货名" span="1">
- <el-input
- disabled
- v-model="deptBudgetList.goodsName"
- placeholder="请输入货名"
- size="small"
- ></el-input>
- </el-form-item>
- <el-form-item style="width: 18%" 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: 37.5%;display: flex;justify-content: space-between;">
- <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
- @change="sendWarehousechange"
- v-model="deptBudgetList.sendWarehouse"
- placeholder="选择仓库"
- class="typeselect"
- filterable clearable
- >
- <el-option
- v-for="item in warehouseList"
- :key="item.constKey"
- :label="item.warehouseName"
- :value="item.warehouseName"
- ></el-option>
- </el-select>
- </div>
- <el-form-item style="width: 30.333%;margin-left:7px;" 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"
- style="width: 30.633%"
- >
- <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: 37.9%"
- >
- <el-select
- @change="sendWarehousechange1"
- v-model="deptBudgetList.receiveWarehouse"
- :disabled="warehouse"
- placeholder="请输入收货库点"
- style="width: 100%"
- filterable clearable
- >
- <el-option
- v-for="item in warehouseList1"
- :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"
- style="width: 30.333%"
- >
- <el-cascader
- :options="options_"
- v-model="selectedOptions1"
- clearable
- size="large"
- placeholder="请选择终到地"
- @change="handleChange1"
- />
- </el-form-item>
- <el-form-item
- style="width: 31.633%"
- label="终到地详细地址"
- span="1"
- prop="endDetailedAddress"
- class="bg-right start-address"
- >
- <el-input
- @change="endDetailedAddressChange"
- v-model="deptBudgetList.endDetailedAddress"
- placeholder="请输入终到地详细地址"
- maxlength="20"
- size="small"
- ></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="item.id"
- >
- <div class="driver">
- <span>运输阶段{{ item.key }} {{ 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)"
- src="../../../public/img/del.png"
- alt
- /> -->
- <!-- <el-checkbox
- @change="(val) => {engflagchange(val, index)}"
- class="endflag"
- true-label="1"
- :disabled='disabled'
- 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)
- }
- "
- filterable clearable
- >
- <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="sender">
- <el-select
- v-model="item.sender"
- placeholder="请选择发货人"
- filterable clearable
- @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 clearable
- @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 { packList } from '@/model/contarct/index'
- import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
- import { addtrantask, getwarehousename, xialaNo,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: [],
- disabled:false,
- deptBudgetList: {
- taskNo: '',
- totalStorage: 0,
- // goodsName: '玉米',
- // goodsNameKey: 1,
- warehouseType: '1',
- tranProcessInfoList: [
- {
- sort: 0,
- processNo: '',
- tranType: '汽运',
- tranTypeKey: '1',
- deliveryDateStart: '',
- deliveryDateEnd: '',
- weight: '',
- selectedOptions: [],
- selectedOptions1: [],
- sendPrivate: '',
- sendCity: '',
- sendArea: '',
- receivePrivate: '',
- receiveCity: '',
- receiveArea: '',
- sendDetailedAddress: '',
- receiveDetailedAddress: '',
- sender: '',
- receiver: '',
- key: 1,
- senderPhone: '',
- receiverPhone: '',
- endFlag: '0',
- },
- ],
- },
- radio: '1',
- options_: regionData,
- heightData: '600px',
- zoom: 7,
- options: [],
- selectedOptions: [],
- selectedOptions1: [],
- window: '',
- district: null,
- goodnameList: [],
- listDate: { country: '中国', level: 'country', city: '' },
- citylist: [],
- taskType: [],
- taskwayList: [],
- contractNoList: [],
- compId: localStorage.getItem('ws-pf_compId'),
- mainReportAdd: {},
- appendixIdsAdd: '',
- warehouseList: [],
- warehouseList1: [],
- size: 10,
- value1: '',
- unitList: [],
- name: '',
- age: '',
- number: 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
- )
- }
- }
- },
- 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
- }
- },
- 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
- }
- }
- },
- 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
- },
- 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 = ''
- // }
- },
- // 获取当前年月日
- getdate() {
- var date = new Date()
- var year = date.getFullYear() //获取完整的年份(4位)
- var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
- var datetime = date.getDate() //获取当前日(1-31)
- if (mouth < 10) {
- mouth = '0' + mouth
- }
- if (datetime < 10) {
- datetime = '0' + datetime
- }
- return year +'' + mouth + datetime
- },
- MathRand() {
- var Num = ''
- for (var i = 0; i < 4; i++) {
- Num += Math.floor(Math.random() * 10)
- }
- return Num
- },
- // 随机验证码
- verifyinit() {
- var arr = []
- for (var i = 48; i < 123; i++) {
- if (i > 57 && i < 65) continue
- if (i > 90 ) continue
- arr.push(String.fromCharCode(i))
- }
- arr.sort(function () {
- return Math.random() - 0.5
- })
- arr.length = 4
- return arr.join('')
- },
- loaddata() {
- this.deptBudgetList.taskNo = 'YS' + this.getdate() + this.MathRand()
- this.deptBudgetList.tranProcessInfoList[0].processNo =
- this.deptBudgetList.taskNo + '-1'
- // 货名
- 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
- })
- 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
- })
- getstaff({ compId: localStorage.getItem('ws-pf_compId') })
- .toPromise()
- .then((response) => {
- // this.agent = response
- this.options = response
- this.staffList = response
- this.sender = response
- })
- xialaNo({
- compId: this.compId,
- flag: 7,
- })
- .toPromise()
- .then((response) => {
- this.contractNoList = response
- })
- },
- confirmPositioncity() {
- this.listDate.level = 'city'
- this.listDate.country = this.name
- },
- // 关闭 dialog时 处理文件url 初始化upload组件
- handleClose() {
- this.dialogViewSpareMoney = false
- },
- add(index) {
- this.deptBudgetList.tranProcessInfoList.push({
- processNo:
- this.deptBudgetList.taskNo +
- '-' +
- (this.deptBudgetList.tranProcessInfoList.length + 1),
- tranType: '汽运',
- tranTypeKey: '1',
- deliveryDateStart: '',
- deliveryDateEnd: '',
- weight:
- this.deptBudgetList.tranProcessInfoList[
- this.deptBudgetList.tranProcessInfoList.length - 1
- ].weight,
- selectedOptions: [],
- selectedOptions1: [],
- sendPrivate: '',
- sendCity: '',
- sendArea: '',
- receivePrivate: '',
- receiveCity: '',
- receiveArea: '',
- sendDetailedAddress: '',
- receiveDetailedAddress: '',
- sender: '',
- receiver: '',
- key: this.deptBudgetList.tranProcessInfoList.length + 1,
- senderPhone: '',
- receiverPhone: '',
- endFlag: '0',
- })
- },
- del(index) {
- if (this.deptBudgetList.tranProcessInfoList.length > 1) {
- this.deptBudgetList.tranProcessInfoList.splice(index, 1)
- }
- for (let i = 0; i < this.deptBudgetList.tranProcessInfoList.length; i++) {
- this.$set(this.deptBudgetList.tranProcessInfoList[i], 'key', i + 1)
- this.$set(
- this.deptBudgetList.tranProcessInfoList[i],
- 'processNo',
- this.deptBudgetList.taskNo + '-' + (i + 1)
- )
- }
- this.$forceUpdate()
- },
- 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' })
- this.deptBudgetList = {
- taskNo: '',
- totalStorage: 0,
- goodsName: '玉米',
- goodsNameKey: 1,
- warehouseType: '1',
- tranProcessInfoList: [
- {
- processNo: '',
- tranType: '汽运',
- tranTypeKey: '1',
- deliveryDateStart: '',
- deliveryDateEnd: '',
- weight: '',
- selectedOptions: [],
- selectedOptions1: [],
- sendPrivate: '',
- sendCity: '',
- sendArea: '',
- receivePrivate: '',
- receiveCity: '',
- receiveArea: '',
- sendDetailedAddress: '',
- receiveDetailedAddress: '',
- sender: '',
- receiver: '',
- senderPhone: '',
- receiverPhone: '',
- },
- ],
- }
- },
- 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
- }
- }
- },
- onChange(files) {
- this.fileNum = files
- this.$refs.upload.handleSaveBill().then((res) => {})
- },
- 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].receiveDetailedAddress.length>20||this.deptBudgetList.tranProcessInfoList[i].receiveDetailedAddress.length<2
- ) {
- this.$message({
- message: '收获详细地址输入错误!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].sendDetailedAddress) {
- this.$message({
- message: '发货详细地址不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tranProcessInfoList[i].sendDetailedAddress.length>20||this.deptBudgetList.tranProcessInfoList[i].sendDetailedAddress.length<2) {
- this.$message({
- message: '发货详细地址输入错误!',
- type: 'warning',
- })
- return
- }
- }
- // if (this.deptBudgetList.endFlag=='1') {
- this.$confirm(`运输任务提交成功后将派发到物流部门,是否确定提交?`, {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- this.$refs.deptBudgetList.validate((valid) => {
- if (valid) {
- this.deptBudgetList.compId =
- localStorage.getItem('ws-pf_compId')
- console.log()
- 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]]
- // if (this.endflag) {
- // 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]]
- // }
- if (
- this.deptBudgetList.taskType != '销售出库' ||
- this.deptBudgetList.taskType != '贸易服务出库' ||
- this.deptBudgetList.taskType != '暂存出库'
- ){
- this.deptBudgetList.endPrivate = CodeToText[this.selectedOptions1[0]]
- this.deptBudgetList.endCity = CodeToText[this.selectedOptions1[1]]
- this.deptBudgetList.endArea = CodeToText[this.selectedOptions1[2]]
- }
- for (
- var i = 0;
- i < this.deptBudgetList.tranProcessInfoList.length;
- i++
- ) {
- this.deptBudgetList.tranProcessInfoList[i].sort = i
- }
- addtrantask(this.deptBudgetList)
- .toPromise()
- .then((response) => {
- this.$message.success('添加成功')
- this.deptBudgetList = {
- taskNo: '',
- totalStorage: 0,
- goodsName: '玉米',
- goodsNameKey: 1,
- warehouseType: '1',
- tranProcessInfoList: [
- {
- processNo: '',
- tranType: '汽运',
- tranTypeKey: '1',
- deliveryDateStart: '',
- deliveryDateEnd: '',
- weight: '',
- selectedOptions: [],
- selectedOptions1: [],
- sendPrivate: '',
- sendCity: '',
- sendArea: '',
- receivePrivate: '',
- receiveCity: '',
- receiveArea: '',
- sendDetailedAddress: '',
- receiveDetailedAddress: '',
- sender: '',
- receiver: '',
- senderPhone: '',
- receiverPhone: '',
- contractNo: '',
- receiveWarehouse: '',
- },
- ],
- }
- 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')
- // console.log(this.checkList.toString())
- // 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]]
- // // if (this.endflag) {
- // // 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]]
- // // }
- // if (
- // this.deptBudgetList.taskType != '销售出库' ||
- // this.deptBudgetList.taskType != '贸易服务出库' ||
- // this.deptBudgetList.taskType != '暂存出库'
- // ){
- // this.deptBudgetList.endPrivate = CodeToText[this.selectedOptions1[0]]
- // this.deptBudgetList.endCity = CodeToText[this.selectedOptions1[1]]
- // this.deptBudgetList.endArea = CodeToText[this.selectedOptions1[2]]
- // }
- // for (
- // var i = 0;
- // i < this.deptBudgetList.tranProcessInfoList.length;
- // i++
- // ) {
- // this.deptBudgetList.tranProcessInfoList[i].sort = i
- // }
- // addtrantask(this.deptBudgetList)
- // .toPromise()
- // .then((response) => {
- // this.$message.success('添加成功')
- // this.deptBudgetList = {
- // taskNo: '',
- // totalStorage: 0,
- // goodsName: '玉米',
- // goodsNameKey: 1,
- // warehouseType: '1',
- // tranProcessInfoList: [
- // {
- // processNo: '',
- // tranType: '汽运',
- // deliveryDateStart: '',
- // deliveryDateEnd: '',
- // weight: '',
- // selectedOptions: [],
- // selectedOptions1: [],
- // sendPrivate: '',
- // sendCity: '',
- // sendArea: '',
- // receivePrivate: '',
- // receiveCity: '',
- // receiveArea: '',
- // sendDetailedAddress: '',
- // receiveDetailedAddress: '',
- // sender: '',
- // receiver: '',
- // senderPhone: '',
- // receiverPhone: '',
- // contractNo: '',
- // receiveWarehouse: '',
- // },
- // ],
- // }
- // this.$router.push({ path: 'tranManagementTransport' })
- // })
- // } else {
- // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
- // return false
- // }
- // })
- // })
- // .catch(() => {
- // return false
- // })
- // }
- },
- resetForm(deptBudgetList) {
- this.$refs[deptBudgetList].resetFields()
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .position {
- position: relative;
- border: 1px solid #5473e8;
- border-radius: 4px;
- margin-top: 20px;
- background: #f6f7fc;
- border-left: 5px solid #5473e8;
- }
- /deep/.position .ws-info-table .el-form-item {
- width: 25%;
- height: 50px;
- }
- /deep/.position .el-select,
- /deep/.el-select {
- width: 100%;
- }
- /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;
- font-size: 14px;
- color: #8890b1;
- }
- .typeselect {
- width: 42%;
- margin-left: 32px;
- }
- .del,
- .add {
- cursor: pointer;
- margin-left: 10px;
- }
- .el-checkbox-group {
- font-size: 0;
- float: right;
- margin-left: 25px;
- }
- .check-box {
- float: left;
- font-size: 14px;
- color: #8890b1;
- }
- .el-checkbox__label {
- color: #8890b1;
- }
- .el-form {
- padding: 0 10%;
- }
- .ws-info-table {
- border: none;
- }
- /deep/.ws-info-table .el-form-item {
- border-right: 1px solid #cdd2dc;
- border-bottom: 1px solid #cdd2dc;
- }
- .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;
- }
- .endflag {
- vertical-align: top;
- }
- .el-col {
- background: #f6f7fc;
- }
- .bg-left {
- padding-left: 30px;
- }
- .bg-right {
- padding-right: 10px;
- text-align: right;
- }
- .bg-bottom {
- margin: 15px 0px;
- }
- .el-radio,
- .el-radio__input {
- margin-top: 11px;
- margin-left: 11px;
- width: 93px;
- }
- .driver {
- margin-top: 10px;
- font-weight: bold;
- margin-left: 20px;
- color: #5473e8;
- font-size: 16px;
- }
- /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/.el-table--border:after,
- /deep/.el-table--group:after,
- /deep/.el-table:before {
- background: transparent;
- }
- //输入框标题
- /deep/.ws-info-table .el-form-item .el-form-item__label {
- background: #ffffff;
- width: min-content;
- font-size: 14px;
- color: #8890b1;
- }
- //表单子项
- /deep/.ws-info-table .el-form-item {
- width: 20%;
- border: none;
- height: 50px;
- }
- //输入框
- /deep/.ws-info-table .el-form-item .el-form-item__content {
- border: none;
- font-size: 14px;
- color: #8890b1;
- }
- /deep/ .el-input--small .el-input__inner {
- font-size: 14px;
- color: #8890b1;
- }
- .el-form-item.start-address.el-form-item--small {
- width: 31.9%;
- }
- .el-cascader {
- width: 100%;
- }
- .el-form {
- height: 73vh;
- overflow: scroll;
- }
- .ws-info-table .contractNoselect{
- width:25%;
- }
- </style>
|