| | |
| | | <!-- 第二块:承运合同、始发地、目的地、车型、车型最大容积、距离、运输时效、运输类型、结算方式、币别、汇率、运费、总体积、装载率、运输方式 --> |
| | | <div class="form-group"> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <!-- <el-col :span="6"> |
| | | <el-form-item label="始发地" prop="HBeginAddrName"> |
| | | <el-input v-model="form.HBeginAddrName" placeholder="请输入始发地"> |
| | | <el-button slot="append" icon="el-icon-search" |
| | |
| | | @click="openDataDialog(3, areaType = 'e')"></el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="车型" prop="HCarTypeName"> |
| | | <el-input v-model="form.HCarTypeName" placeholder="请输入车型"> |
| | | <el-button slot="append" icon="el-icon-search" |
| | | @click="openDataDialog(13)"></el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | </el-col> --> |
| | | <el-col :span="6"> |
| | | <el-form-item label="承运合同" prop="HContractTransportBillNo"> |
| | | <el-input v-model="form.HContractTransportBillNo" placeholder="请输入承运合同"> |
| | | <el-input v-model="form.HContractTransportBillNo" placeholder="请输入承运合同" |
| | | @change="transChange"> |
| | | <el-button slot="append" icon="el-icon-search" |
| | | @click="openDataDialog(16)"></el-button> |
| | | </el-input> |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="运输线路" prop="HTransportLineName"> |
| | | <el-select v-model="form.HTransportLineName" placeholder="请选择运输线路" filterable |
| | | @change="checkAndCallGetTransCost" @focus="checkTransportList"> |
| | | <el-option v-for="(item, index) in transportList" :key="index" :label="item" |
| | | :value="item"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="运输方式" prop="HTransType"> |
| | | <el-select v-model="form.HTransType" placeholder="请选择运输方式"> |
| | | <el-select v-model="form.HTransType" placeholder="请选择运输方式" |
| | | @change="checkAndCallGetTransCost"> |
| | | <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-button slot="append" icon="el-icon-search" |
| | | @click="openDataDialog(13)"></el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="始发地" prop="HBeginAddrName"> |
| | | <el-input v-model="form.HBeginAddrName" placeholder="请输入始发地"> |
| | | <el-button slot="append" icon="el-icon-search" |
| | | @click="openDataDialog(3, areaType = 'b')"></el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="目的地" prop="HEndAddrName"> |
| | | <el-input v-model="form.HEndAddrName" placeholder="请输入目的地"> |
| | | <el-button slot="append" icon="el-icon-search" |
| | | @click="openDataDialog(3, areaType = 'e')"></el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="运费" prop="HMoney"> |
| | | <el-input v-model="form.HMoney" placeholder="请输入运费" /> |
| | | <el-input v-model="form.HMoney" placeholder="请输入运费" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="币别" prop="HCurName"> |
| | | <el-input v-model="form.HCurName" placeholder="请输入币别" /> |
| | | </el-form-item> |
| | |
| | | <el-table-column align="center" label="物料规格" width="120"> |
| | | <template slot-scope="scope">{{ scope.row.HModel }} </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="容器代码" width="120"> |
| | | <el-table-column v-if="false" align="center" label="容器代码" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.HMouldNumber" placeholder="请输入器具代码" |
| | | @keyup.native.f7="openDataDialog(17, scope.row)" |
| | | @dblclick.native="openDataDialog(17, scope.row)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="容器名称" width="120"> |
| | | <el-table-column v-if="false" align="center" label="容器名称" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.HMouldName }}</span> |
| | | </template> |
| | |
| | | @change="checkTotalQtyExceed(scope.row)"></el-input-number> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="标准包装数量" width="120"> |
| | | <el-table-column v-if="false" align="center" label="标准包装数量" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.HSNP }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="包装容器数量" width="170"> |
| | | <el-table-column v-if="false" align="center" label="包装容器数量" width="170"> |
| | | <template slot-scope="scope"> |
| | | <el-input-number v-model="scope.row.HMouldQty" :min="0" style="width: 90px;" |
| | | <el-input-number v-model="scope.row.HMouldQty" :min="0" style="width: 150px;" |
| | | controls-position="right" |
| | | @change="changeHMouldQty(scope.row)"></el-input-number> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="容器数量/托" width="120"> |
| | | <el-table-column v-if="false" align="center" label="容器数量/托" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.HStandardQtyForMouldInPack }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="托数" width="120"> |
| | | <el-table-column v-if="false" align="center" label="托数" width="120"> |
| | | <template slot-scope="scope"> <!--HPackQTY=HMouldQty/HStandardQtyForMouldInPack --> |
| | | <el-input-number v-model="scope.row.HPackQTY" :min="0" style="width: 90px;" |
| | | controls-position="right" @change="changeHPackQty(scope.row)"></el-input-number> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="托单位体积" width="120"> |
| | | <el-table-column v-if="false" align="center" label="托单位体积" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.HPackV }}</span> |
| | | </template> |
| | |
| | | controls-position="right"></el-input-number> --> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="容器长度" width="120"> |
| | | <el-table-column v-if="false" align="center" label="容器长度" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.HMouldLength }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="容器宽度" width="120"> |
| | | <el-table-column v-if="false" align="center" label="容器宽度" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.HMouldWidth }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="容器高度" width="120"> |
| | | <el-table-column v-if="false" align="center" label="容器高度" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.HMouldHeight }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="折叠高度" width="120"> |
| | | <el-table-column v-if="false" align="center" label="折叠高度" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.HMouldFoldHeight }}</span> |
| | | </template> |
| | |
| | | import ContractTransport from "@/views/basic/gytransport/cgContractTransportBillList/Cg_ContractTransportBillList.vue" |
| | | import GyMaterialPackingRelation from '@/views/scMould/basicModeling/Gy_MaterialPackingRelationList.vue' |
| | | import AreaDialog from "@/views/component/AreaDialog" |
| | | import { watch } from 'vue'; |
| | | |
| | | export default { |
| | | name: 'Add_Edit_WL_YayBill.vue', |
| | | components: { Dept, Warehouse, Material, RowSettings, XsSeOutStockBill, GyCustomer, GySupplier, GyCartype, GyCar, GyDriver, ContractTransport, GyMaterialPackingRelation, AreaDialog }, |
| | |
| | | |
| | | temp: undefined, //临时变量 |
| | | btResList: [], // 列设置 |
| | | transportList: [], //运输线路选择列表 |
| | | form: {}, // 表单参数 |
| | | rules: { // 表单校验 |
| | | HCarrierName: [ |
| | |
| | | HCusName: [ |
| | | { required: true, message: "客户不能为空", trigger: "blur" } |
| | | ], |
| | | HCarTypeName:[ |
| | | HCarTypeName: [ |
| | | { required: true, message: "车型不能为空", trigger: "blur" } |
| | | ], |
| | | HDate: [ |
| | |
| | | ], |
| | | HCarrierName: [ |
| | | { required: true, message: "承运合同不能为空", trigger: "blur" } |
| | | ], |
| | | HContractTransportBillNo: [ |
| | | { required: true, message: "承运合同不能为空", trigger: "blur" } |
| | | ], |
| | | HTransType: [ |
| | | { required: true, message: "运输方式不能为空", trigger: "blur" } |
| | | ], |
| | | HTransportLineName: [ |
| | | { required: true, message: "运输线路不能为空", trigger: "blur" } |
| | | ] |
| | | }, |
| | | |
| | |
| | | HPickAddr: "", |
| | | HArriverAddr: "", |
| | | HTransType: "", |
| | | HTransportLineName: "", |
| | | HCarTypeID: 0, |
| | | HCarTypeName: "", |
| | | HCarTypeMaxVolume: 0, |
| | |
| | | this.form.HCarName = data.车辆名称 |
| | | this.form.HDriverID = data.司机ID |
| | | this.form.HDriverName = data.司机名称 |
| | | |
| | | this.form.HTransportLineName = data.运输路线名称 |
| | | //子表 赋值 |
| | | for (var i = 0; i < result.data.length; i++) { |
| | | var qty = parseFloat(result.data[i].HQty) || 0; |
| | |
| | | "HQty_origin": result.data[i].HQty, |
| | | "HVolume": rowVolume, |
| | | "HScatteredVolume": result.data[i].零单占用体积, |
| | | "HStandardQtyForMouldInPack":result.data[i].HStandardQtyForMouldInPack, |
| | | "HPackV":result.data[i].HPackV, |
| | | "HPackQTY":result.data[i].HPackQTY, |
| | | "HStandardQtyForMouldInPack": result.data[i].HStandardQtyForMouldInPack, |
| | | "HPackV": result.data[i].HPackV, |
| | | "HPackQTY": result.data[i].HPackQTY, |
| | | } |
| | | ) |
| | | } |
| | |
| | | this.calculateLoadingRate(parseFloat(this.form.HTotalVolume || 0)); |
| | | this.gyCartypeShow = false |
| | | this.openData = false |
| | | this.checkAndCallGetTransCost() |
| | | } else if (num == 14) { |
| | | this.form.HCarName = deptRow.车辆名称 |
| | | this.form.HCarID = deptRow.HItemID |
| | |
| | | console.log(deptRow) |
| | | this.form.HContractTransportBillNo = deptRow.单据号 |
| | | this.form.HContractTransportInterID = deptRow.HInterID |
| | | this.form.HContractTransportEntryID = deptRow.HInterID |
| | | this.form.HDistance = deptRow.距离 |
| | | this.form.HTransportTimes = deptRow.运输时效 |
| | | this.form.HTransportTyep = deptRow.运输类型 |
| | | this.form.HTransType = deptRow.运输类型 |
| | | this.form.HSSID = deptRow.结算方式 |
| | | this.form.HSSName = deptRow.结算方式名称 |
| | | this.form.HCurID = deptRow.币别 |
| | | this.form.HCurName = deptRow.货币名称 |
| | | this.form.HMoney = deptRow.运输费用 |
| | | this.form.HExRate = deptRow.汇率 == null ? 0 : deptRow.汇率 |
| | | this.form.HCarrierID = deptRow.HSupID |
| | | this.form.HCarrierName = deptRow.供应商名称 |
| | | this.transportList = [] |
| | | axios.get(this.$baseUrl + '/WLYayBillController/initDataForSelectContractTransportBill', { |
| | | params: { |
| | | "hmainid": deptRow.HInterID, |
| | | }, |
| | | }).then(res => { |
| | | let response = res.data |
| | | if (response.code == 1) { |
| | | this.form.HContractTransportEntryID = response.data[0].HEntryID |
| | | this.form.HCarrierID = response.data[0].HSupID |
| | | this.form.HCarrierName = response.data[0].供应商名称 |
| | | this.form.HCurID = response.data[0].币别 |
| | | this.form.HCurName = response.data[0].货币名称 |
| | | this.form.HExRate = response.data[0].汇率 == null ? 0 : response.data.汇率 |
| | | this.form.HSSID = response.data[0].结算方式 |
| | | this.form.HSSName = response.data[0].结算方式名称 |
| | | response.data.map(item => { |
| | | this.transportList.push(item.运输路线名称) |
| | | }) |
| | | this.checkAndCallGetTransCost() |
| | | } else { |
| | | this.$modal.msgError("错误:" + response.data.code + response.data.Message); |
| | | } |
| | | }).catch(error => { |
| | | this.$modal.msgError("接口请求失败!"); |
| | | }); |
| | | this.ContractTransportShow = false |
| | | this.openData = false |
| | | } else if (num == 17) { |
| | |
| | | "HMouldWidth": res[j].宽度, |
| | | "HMouldHeight": res[j].高度, |
| | | "HMouldFoldHeight": res[j].折叠高度, |
| | | "HModel":res[j].物料规格, |
| | | "HModel": res[j].物料规格, |
| | | "HQty": res[j].物料数量, |
| | | "HQty_origin": orginHQTY, |
| | | "HMouldQty": mouldQty, |
| | |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | this.form.HCarryStatus = 0; |
| | | var loadingRate = this.form.HLoadingRate; |
| | | if (loadingRate && typeof loadingRate === 'string') { |
| | | this.form.HLoadingRate = parseFloat(loadingRate.replace('%', '')) / 100; |
| | |
| | | }, |
| | | //#endregion |
| | | //#endregion |
| | | transChange(val) { |
| | | console.log(val) |
| | | this.checkAndCallGetTransCost() |
| | | }, |
| | | checkTransportList() { |
| | | if (this.transportList.length === 0) { |
| | | this.$message.warning('请先选择承运合同') |
| | | } |
| | | }, |
| | | checkAndCallGetTransCost() { |
| | | const { HContractTransportBillNo, HCarTypeName, HTransType, HTransportLineName } = this.form |
| | | |
| | | if (!HContractTransportBillNo) { |
| | | this.$message.warning('请先选择承运合同') |
| | | return |
| | | } |
| | | if (!HTransportLineName) { |
| | | this.$message.warning('请先选择运输线路') |
| | | return |
| | | } |
| | | if (!HTransType) { |
| | | this.$message.warning('请先选择运输方式') |
| | | return |
| | | } |
| | | if (HTransType !== '零单' && !HCarTypeName) { |
| | | this.$message.warning('请先选择车型') |
| | | return |
| | | } |
| | | |
| | | this.getTransCost() |
| | | }, |
| | | getTransCost() { |
| | | axios.get(this.$baseUrl + '/WLYayBillController/getSelectContractTransportBillEntryData', { |
| | | params: { |
| | | HSupID: this.form.HCarrierID, |
| | | HTransportLineName: this.form.HTransportLineName, |
| | | HCarTypeID: this.form.HCarTypeID, |
| | | HTransportTyep: this.form.HTransType, |
| | | }, |
| | | }).then(res => { |
| | | let response = res.data |
| | | if (response.code == 1) { |
| | | if (response.data.length == 0) { |
| | | this.$modal.msgError("未获取到指定承运合同数据,请检查【" + this.form.HCarrierName + '-' + this.form.HTransportLineName + '-' + this.form.HCarTypeName + '-' + this.form.HTransType + "】对应的承运合同是否维护!!!"); |
| | | 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"); |
| | | } |
| | | } else { |
| | | this.$modal.msgError("错误:" + response.code + response.Message); |
| | | } |
| | | }).catch(error => { |
| | | this.$modal.msgError("接口请求失败!"); |
| | | }); |
| | | |
| | | }, |
| | | } |
| | | }; |
| | | </script> |