shipSchedule.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!-- 船期查询 -->
  2. <template>
  3. <view>
  4. <!-- 搜索区 -->
  5. <view style="width: 80%;margin: 10rpx auto;">
  6. <!-- <u-field v-model="polId" label="起始港" placeholder="请选择起始港" type="select" @click="destination = true"></u-field> -->
  7. <u-form-item label="起始港" label-width="100rpx">
  8. <u-input v-model="list.polId" type="select" placeholder="请选择起始港" @click="destination = true" />
  9. </u-form-item>
  10. <u-action-sheet :list="destinationList" v-model="destination" @click="destinationMethod"></u-action-sheet>
  11. <u-form-item label="目的港" label-width="100rpx">
  12. <u-input v-model="list.podId" type="select" placeholder="请选择目的港" @click="destinationtwo = true" />
  13. </u-form-item>
  14. <u-action-sheet :list="destinationList" v-model="destinationtwo" @click="destinationMethodTwo">
  15. </u-action-sheet>
  16. <u-form-item label="开航日" label-width="100rpx">
  17. <u-input v-model="list.sailingDay" :disabled="true" type="select" placeholder="请选择日期" @click="show = true" />
  18. </u-form-item>
  19. <u-calendar max-date="2050" v-model="show" mode="range" @change="change"></u-calendar>
  20. </view>
  21. <!-- <view
  22. style="width: 100%;position:fixed; bottom:0;background-color: #FFFFFF;padding-left: 20px;padding-right: 20px;padding-bottom: 30rpx;">
  23. <u-button type="primary" @click="submit">确认查询</u-button>
  24. </view> -->
  25. <view style="width: 90%;margin: 40rpx auto;">
  26. <u-button type="primary" @click="submit">确认查询</u-button>
  27. </view>
  28. <!-- 历史记录区 -->
  29. <view v-if="historyList > 0">
  30. <view
  31. style="box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);width: 96%;border-top-right-radius: 10rpx;margin: 0 auto;">
  32. <view style="width: 90%;margin: 0 auto;height: 80rpx;margin: 0 auto;line-height: 80rpx;">
  33. <view style="float: left;">历史记录</view>
  34. <view style="color: #279cfd;float: right;" @click="deleteAll()">清除全部</view>
  35. </view>
  36. <view
  37. style="width: 100%;height: 80rpx;margin: 0 auto;line-height: 80rpx;padding: 0 5% 0 5%;border-top: 1rpx solid #eff4ff;"
  38. v-for="(item,index) in historyList" :key="index">
  39. <view style="float: left;">{{item.fPortOriginName}}——{{item.fPortDestinationName}}</view>
  40. <view style="color: #279cfd;float: right;">
  41. <u-icon name="trash" color="#ccc" @click="deleteRecord(item.fId)"></u-icon>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. show: false,
  53. mode: 'range',
  54. list:{},
  55. form: {
  56. fQueryFrom: 'app',
  57. pageNum: 1,
  58. pageSize: 10,
  59. },
  60. destination: false,
  61. destinationtwo: false,
  62. destinationList: [],
  63. historyList: []
  64. }
  65. },
  66. created() {
  67. this.destinationList = []
  68. this.$u.get('/shipping/address/selectPortName').then(res => {
  69. console.log(res)
  70. for (let item in res.rows) {
  71. this.destinationList.push({
  72. value: res.rows[item].fId,
  73. text: res.rows[item].fName
  74. })
  75. }
  76. })
  77. this.history()
  78. },
  79. methods: {
  80. //查询历史搜索记录
  81. history() {
  82. this.$u.get('/quotation/queryseapricelog/list').then(res => {
  83. this.historyList = res.rows
  84. })
  85. },
  86. change(e) {
  87. console.log(e)
  88. this.form.fValiddateBegin = e.startDate
  89. this.form.fValiddateEnd = e.endDate
  90. this.list.sailingDay = e.startDate + ' - ' + e.endDate
  91. },
  92. destinationMethod(index) {
  93. this.list.polId = this.destinationList[index].text
  94. this.form.polId = this.destinationList[index].value
  95. },
  96. destinationMethodTwo(index) {
  97. this.list.podId = this.destinationList[index].text
  98. this.form.podId = this.destinationList[index].value
  99. },
  100. submit() {
  101. if (!this.form.polId) return this.textTips('请选择起始港')
  102. if (!this.form.podId) return this.textTips('请选择目的港')
  103. if (!this.form.fValiddateBegin || !this.form.fValiddateEnd) return this.textTips('请选择开航日期')
  104. this.$u.route('/pages/home/freightCalculation/shippingInformation',{
  105. form:JSON.stringify(this.form),
  106. list:JSON.stringify(this.list)
  107. });
  108. // this.$u.get('/warehouse/seaprice/query').then(res=>{
  109. // console.log(res)
  110. // })
  111. },
  112. textTips(text){
  113. uni.showToast({
  114. icon: 'none',
  115. title: text,
  116. position: "center"
  117. })
  118. },
  119. deleteRecord(id) {
  120. console.log(id)
  121. if (id) {
  122. this.$u.delete('/quotation/queryseapricelog/' + id).then(res => {
  123. console.log(res)
  124. this.history()
  125. })
  126. } else {
  127. console.log(id)
  128. }
  129. },
  130. deleteAll() {
  131. let id = ''
  132. for (let item in this.historyList) {
  133. id += this.historyList[item].fId + ','
  134. }
  135. id = id.substring(0, id.length - 1);
  136. this.deleteRecord(id)
  137. }
  138. }
  139. }
  140. </script>
  141. <style>
  142. </style>