123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <!-- 船期查询 -->
- <template>
- <view>
- <!-- 搜索区 -->
- <view style="width: 80%;margin: 10rpx auto;">
- <!-- <u-field v-model="polId" label="起始港" placeholder="请选择起始港" type="select" @click="destination = true"></u-field> -->
- <u-form-item label="起始港" label-width="100rpx">
- <u-input v-model="list.polId" type="select" placeholder="请选择起始港" @click="destination = true" />
- </u-form-item>
- <u-action-sheet :list="destinationList" v-model="destination" @click="destinationMethod"></u-action-sheet>
- <u-form-item label="目的港" label-width="100rpx">
- <u-input v-model="list.podId" type="select" placeholder="请选择目的港" @click="destinationtwo = true" />
- </u-form-item>
- <u-action-sheet :list="destinationList" v-model="destinationtwo" @click="destinationMethodTwo">
- </u-action-sheet>
- <u-form-item label="开航日" label-width="100rpx">
- <u-input v-model="list.sailingDay" :disabled="true" type="select" placeholder="请选择日期" @click="show = true" />
- </u-form-item>
- <u-calendar max-date="2050" v-model="show" mode="range" @change="change"></u-calendar>
- </view>
- <!-- <view
- style="width: 100%;position:fixed; bottom:0;background-color: #FFFFFF;padding-left: 20px;padding-right: 20px;padding-bottom: 30rpx;">
- <u-button type="primary" @click="submit">确认查询</u-button>
- </view> -->
- <view style="width: 90%;margin: 40rpx auto;">
- <u-button type="primary" @click="submit">确认查询</u-button>
- </view>
- <!-- 历史记录区 -->
- <view v-if="historyList > 0">
- <view
- style="box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);width: 96%;border-top-right-radius: 10rpx;margin: 0 auto;">
- <view style="width: 90%;margin: 0 auto;height: 80rpx;margin: 0 auto;line-height: 80rpx;">
- <view style="float: left;">历史记录</view>
- <view style="color: #279cfd;float: right;" @click="deleteAll()">清除全部</view>
- </view>
- <view
- style="width: 100%;height: 80rpx;margin: 0 auto;line-height: 80rpx;padding: 0 5% 0 5%;border-top: 1rpx solid #eff4ff;"
- v-for="(item,index) in historyList" :key="index">
- <view style="float: left;">{{item.fPortOriginName}}——{{item.fPortDestinationName}}</view>
- <view style="color: #279cfd;float: right;">
- <u-icon name="trash" color="#ccc" @click="deleteRecord(item.fId)"></u-icon>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- show: false,
- mode: 'range',
- list:{},
- form: {
- fQueryFrom: 'app',
- pageNum: 1,
- pageSize: 10,
- },
- destination: false,
- destinationtwo: false,
- destinationList: [],
- historyList: []
- }
- },
- created() {
- this.destinationList = []
- this.$u.get('/shipping/address/selectPortName').then(res => {
- console.log(res)
- for (let item in res.rows) {
- this.destinationList.push({
- value: res.rows[item].fId,
- text: res.rows[item].fName
- })
- }
- })
- this.history()
- },
- methods: {
- //查询历史搜索记录
- history() {
- this.$u.get('/quotation/queryseapricelog/list').then(res => {
- this.historyList = res.rows
- })
- },
- change(e) {
- console.log(e)
- this.form.fValiddateBegin = e.startDate
- this.form.fValiddateEnd = e.endDate
- this.list.sailingDay = e.startDate + ' - ' + e.endDate
- },
- destinationMethod(index) {
- this.list.polId = this.destinationList[index].text
- this.form.polId = this.destinationList[index].value
- },
- destinationMethodTwo(index) {
- this.list.podId = this.destinationList[index].text
- this.form.podId = this.destinationList[index].value
- },
- submit() {
- if (!this.form.polId) return this.textTips('请选择起始港')
- if (!this.form.podId) return this.textTips('请选择目的港')
- if (!this.form.fValiddateBegin || !this.form.fValiddateEnd) return this.textTips('请选择开航日期')
- this.$u.route('/pages/home/freightCalculation/shippingInformation',{
- form:JSON.stringify(this.form),
- list:JSON.stringify(this.list)
- });
- // this.$u.get('/warehouse/seaprice/query').then(res=>{
- // console.log(res)
- // })
- },
- textTips(text){
- uni.showToast({
- icon: 'none',
- title: text,
- position: "center"
- })
- },
- deleteRecord(id) {
- console.log(id)
- if (id) {
- this.$u.delete('/quotation/queryseapricelog/' + id).then(res => {
- console.log(res)
- this.history()
- })
- } else {
- console.log(id)
- }
- },
- deleteAll() {
- let id = ''
- for (let item in this.historyList) {
- id += this.historyList[item].fId + ','
- }
- id = id.substring(0, id.length - 1);
- this.deleteRecord(id)
- }
- }
- }
- </script>
- <style>
- </style>
|