| | |
| | | </el-col> --> |
| | | <el-col :span="6"> |
| | | <el-form-item label="承运合同" prop="HContractTransportBillNo"> |
| | | <el-input v-model="form.HContractTransportBillNo" placeholder="请输入承运合同" |
| | | @change="transChange"> |
| | | <el-input v-model="form.HContractTransportBillNo" placeholder="请输入承运合同"> |
| | | <el-button slot="append" icon="el-icon-search" |
| | | @click="openDataDialog(16)"></el-button> |
| | | </el-input> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="运输线路" prop="HTransportLineName"> |
| | | <el-select v-model="form.HTransportLineName" placeholder="请选择运输线路" filterable |
| | | @change="checkAndCallGetTransCost" @focus="checkTransportList"> |
| | | @change="transLineNameChange" @focus="checkTransportList"> |
| | | <el-option v-for="(item, index) in transportList" :key="index" :label="item" |
| | | :value="item"></el-option> |
| | | </el-select> |
| | |
| | | <el-col :span="6"> |
| | | <el-form-item label="运输方式" prop="HTransType"> |
| | | <el-select v-model="form.HTransType" placeholder="请选择运输方式" |
| | | @change="checkAndCallGetTransCost"> |
| | | <el-option label="单程" value="单程"></el-option> |
| | | @change="transTypeChange" @focus="checkTransTypeList"> |
| | | <el-option v-for="(item, index) in transTypeList" :key="index" :label="item" |
| | | :value="item"></el-option> |
| | | <!-- <el-option label="单程" value="单程"></el-option> |
| | | <el-option label="往返" value="往返"></el-option> |
| | | <el-option label="单程/往返" value="单程/往返"></el-option> |
| | | <el-option label="零担(发运)" value="零担(发运)"></el-option> |
| | | <el-option label="零担(返货)" value="零担(返货)"></el-option> |
| | | <el-option label="零担(返货)" value="零担(返货)"></el-option> --> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="车型" prop="HCarTypeName"> |
| | | <el-input v-model="form.HCarTypeName" placeholder="请输入车型"> |
| | | <el-select v-model="form.HCarTypeName" placeholder="请选择车型" |
| | | @change="transHCarChange" @focus="checkHCarTypeNameList"> |
| | | <el-option v-for="(item, index) in HCarTypeNameList" :key="index" |
| | | :label="item.value" :value="item.id"></el-option> |
| | | </el-select> |
| | | <!-- <el-input v-model="form.HCarTypeName" placeholder="请输入车型"> |
| | | <el-button slot="append" icon="el-icon-search" |
| | | @click="openDataDialog(13)"></el-button> |
| | | </el-input> |
| | | </el-input> --> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | temp: undefined, //临时变量 |
| | | btResList: [], // 列设置 |
| | | transportList: [], //运输线路选择列表 |
| | | transTypeList: [], |
| | | HCarTypeNameList: [], |
| | | form: {}, // 表单参数 |
| | | rules: { // 表单校验 |
| | | HCarrierName: [ |
| | |
| | | this.form.HContractTransportBillNo = deptRow.单据号 |
| | | this.form.HContractTransportInterID = deptRow.HInterID |
| | | this.transportList = [] |
| | | this.transTypeList = [] |
| | | this.HCarTypeNameList = [] |
| | | axios.get(this.$baseUrl + '/WLYayBillController/initDataForSelectContractTransportBill', { |
| | | params: { |
| | | "hmainid": deptRow.HInterID, |
| | |
| | | }).then(res => { |
| | | let response = res.data |
| | | if (response.code == 1) { |
| | | if (response.data.length == 0) { |
| | | this.$modal.msgError("未获取到指定承运合同数据,请检查【" + this.form.HContractTransportBillNo + "】对应的承运合同是否维护!!!"); |
| | | this.form.HMoney = 0 |
| | | return |
| | | } |
| | | this.form.HContractTransportEntryID = response.data[0].HEntryID |
| | | this.form.HCarrierID = response.data[0].HSupID |
| | | this.form.HCarrierName = response.data[0].供应商名称 |
| | |
| | | this.form.HSSID = response.data[0].结算方式 |
| | | this.form.HSSName = response.data[0].结算方式名称 |
| | | this.transportList = [...new Set(response.data.map(item => item.运输路线名称))] |
| | | this.checkAndCallGetTransCost() |
| | | // this.checkAndCallGetTransCost() |
| | | } else { |
| | | this.$modal.msgError("错误:" + response.data.code + response.data.Message); |
| | | } |
| | |
| | | this.uploadFiles.splice(index, 1) |
| | | }, |
| | | //#endregion |
| | | //#endregion |
| | | transChange(val) { |
| | | console.log(val) |
| | | this.checkAndCallGetTransCost() |
| | | }, |
| | | //#endregion |
| | | checkTransportList() { |
| | | if (this.transportList.length === 0) { |
| | | this.$message.warning('请先选择承运合同') |
| | | } |
| | | }, |
| | | checkTransTypeList() { |
| | | if (this.transTypeList.length === 0) { |
| | | this.$message.warning('请先选择运输线路') |
| | | } |
| | | }, |
| | | checkHCarTypeNameList() { |
| | | if (this.HCarTypeNameList.length === 0) { |
| | | this.$message.warning('请先选择运输线路') |
| | | } |
| | | }, |
| | | transLineNameChange() { |
| | | this.form.HTransType = '' |
| | | this.form.HCarTypeName = '' |
| | | this.transTypeList = [] |
| | | this.HCarTypeNameList = [] |
| | | this.getTransCost('line') |
| | | }, |
| | | transTypeChange() { |
| | | this.form.HCarTypeName = '' |
| | | this.HCarTypeNameList = [] |
| | | this.getTransCost('type') |
| | | }, |
| | | transHCarChange() { |
| | | this.getTransCost('car') |
| | | }, |
| | | checkAndCallGetTransCost() { |
| | | const { HContractTransportBillNo, HCarTypeName, HTransType, HTransportLineName, HCarrierID } = this.form |
| | |
| | | } |
| | | this.getTransCost() |
| | | }, |
| | | getTransCost() { |
| | | getTransCost(val) { |
| | | axios.get(this.$baseUrl + '/WLYayBillController/getSelectContractTransportBillEntryData', { |
| | | params: { |
| | | Cg_ContractTransportBillInterID: this.form.HContractTransportInterID, |
| | | HSupID: this.form.HCarrierID, |
| | | HTransportLineName: this.form.HTransportLineName, |
| | | HCarTypeID: this.form.HCarTypeID, |
| | |
| | | this.form.HMoney = 0 |
| | | return |
| | | } |
| | | this.form.HDistance = response.data[0].距离 |
| | | this.form.HTransportTimes = response.data[0].运输时效 |
| | | this.form.HTransportTyep = response.data[0].运输类型 |
| | | this.form.HMoney = response.data[0].运输费用 |
| | | if (this.form.HMoney == 0) { |
| | | this.$modal.msgError("当前运费为0"); |
| | | if (val == 'line') { |
| | | this.transTypeList = [...new Set(response.data.map(item => item.运输类型))] |
| | | } else if (val == 'type') { |
| | | const carTypeMap = new Map() |
| | | response.data.forEach(item => { |
| | | const key = item.运输方式名称 |
| | | if (!carTypeMap.has(key)) { |
| | | carTypeMap.set(key, { value: item.运输方式名称, id: item.运输方式 }) |
| | | } |
| | | }) |
| | | this.HCarTypeNameList = Array.from(carTypeMap.values()) |
| | | } else if (val == 'car') { |
| | | this.form.HDistance = response.data[0].距离 |
| | | this.form.HTransportTimes = response.data[0].运输时效 |
| | | this.form.HTransportTyep = response.data[0].运输类型 |
| | | this.form.HMoney = response.data[0].运输费用 |
| | | if (this.form.HMoney == 0) { |
| | | this.$modal.msgError("当前运费为0"); |
| | | } |
| | | } |
| | | } else { |
| | | this.$modal.msgError("错误:" + response.code + response.Message); |