wangyi
7 天以前 939636dd7cc056f66cf7880fd2d032a138b56133
src/views/logistics/transportGPS/Add_Edit_WL_YayBill.vue
@@ -988,6 +988,11 @@
                    this.formShow = true
                    this.formLoading = false
                    // 加载运输线路、运输类型、车型列表
                    if (this.form.HContractTransportInterID) {
                        this.loadTransportData()
                    }
                    // 加载已上传的文件列表
                    this.getFileList();
@@ -1171,12 +1176,11 @@
                            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.HCurID = response.data[0].币别
                        this.form.HCurName = response.data[0].货币名称
                        this.form.HExRate = response.data[0].汇率 == null ? 0 : response.data[0].汇率
                        this.form.HExRate = response.data[0].汇率 == null ? 0 : response.data[0].汇率 - 0
                        this.form.HSSID = response.data[0].结算方式
                        this.form.HSSName = response.data[0].结算方式名称
                        this.transportList = [...new Set(response.data.map(item => item.运输路线名称))]
@@ -1497,6 +1501,7 @@
                    var sSubStr = JSON.stringify(this.editData);
                    // var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"] + ';' + this.OperationType;
                    var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"]
                    console.log(sMainSub)
                    axios({
                        method: 'post',
                        url: this.baseURL + "/WLYayBillController/SaveBill",
@@ -2091,6 +2096,44 @@
            });
        },
        // 加载运输相关数据
        loadTransportData() {
            axios.get(this.$baseUrl + '/WLYayBillController/initDataForSelectContractTransportBill', {
                params: {
                    "hmainid": this.form.HContractTransportInterID,
                },
            }).then(res => {
                let response = res.data
                if (response.code == 1) {
                    // 运输线路去重
                    this.transportList = [...new Set(response.data.map(item => item.运输路线名称))]
                    // this.$nextTick(()=>{
                    // })
                    this.getTransCost('line')
                    this.getTransCost('type')
                    this.getTransCost('car')
                    // // 运输类型去重
                    // this.transTypeList = [...new Set(response.data.map(item => item.运输类型))]
                    // // 车型去重
                    // 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 {
                    this.$modal.msgError("错误:" + response.data.code + response.data.Message);
                }
            }).catch(error => {
                this.$modal.msgError("接口请求失败!");
            });
        },
        // 获取已上传文件列表
        getFileList() {
        },
@@ -2119,16 +2162,51 @@
        transLineNameChange() {
            this.form.HTransType = ''
            this.form.HCarTypeName = ''
            this.form.HCarTypeID = 0
            this.form.HContractTransportEntryID = 0
            this.form.HBeginAddrName = ''
            this.form.HBeginAddr = 0
            this.form.HEndAddrName = ''
            this.form.HEndAddr = 0
            this.form.HCarTypeMaxVolume = 0
            this.form.HDistance = 0
            this.form.HTransportTimes = ''
            this.form.HTransportTyep = ''
            this.form.HMoney = 0
            this.transTypeList = []
            this.HCarTypeNameList = []
            this.getTransCost('line')
        },
        transTypeChange() {
            this.form.HCarTypeName = ''
            this.form.HCarTypeID = 0
            this.form.HContractTransportEntryID = 0
            this.form.HBeginAddrName = ''
            this.form.HBeginAddr = 0
            this.form.HEndAddrName = ''
            this.form.HEndAddr = 0
            this.form.HCarTypeMaxVolume = 0
            this.form.HDistance = 0
            this.form.HTransportTimes = ''
            this.form.HTransportTyep = ''
            this.form.HMoney = 0
            this.HCarTypeNameList = []
            this.getTransCost('type')
        },
        transHCarChange() {
        transHCarChange(val) {
            this.form.HContractTransportEntryID = 0
            this.form.HBeginAddrName = ''
            this.form.HBeginAddr = 0
            this.form.HEndAddrName = ''
            this.form.HEndAddr = 0
            this.form.HCarTypeMaxVolume = 0
            this.form.HDistance = 0
            this.form.HTransportTimes = ''
            this.form.HTransportTyep = ''
            this.form.HMoney = 0
            let item = this.HCarTypeNameList.find(item => item.id === val);
            this.form.HCarTypeName = item.value
            this.form.HCarTypeID = val
            this.getTransCost('car')
        },
        checkAndCallGetTransCost() {
@@ -2185,11 +2263,12 @@
                        })
                        this.HCarTypeNameList = Array.from(carTypeMap.values())
                    } else if (val == 'car') {
                        this.form.HContractTransportEntryID = response.data[0].HEntryID
                        this.form.HBeginAddrName = response.data[0].始发地名称
                        this.form.HBeginAddr = response.data[0].始发地
                        this.form.HEndAddrName = response.data[0].目的地名称
                        this.form.HEndAddr = response.data[0].目的地
                        this.form.HCarTypeMaxVolume = response.data[0].车辆最大容积
                        this.form.HCarTypeMaxVolume = response.data[0].车型最大容积
                        this.form.HDistance = response.data[0].距离
                        this.form.HTransportTimes = response.data[0].运输时效
                        this.form.HTransportTyep = response.data[0].运输类型