indexItem.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <el-dialog title="提单号明细" width="80%" :visible.sync="open" @close="close">
  3. <div style="display: flex; margin-bottom: 10px">
  4. <el-date-picker
  5. type="datetime"
  6. placeholder="选择离港时间"
  7. format="yyyy-MM-dd HH:mm"
  8. value-format="yyyy-MM-dd HH:mm"
  9. size="mini"
  10. v-model="departure"
  11. style="margin-right: 10px"
  12. ></el-date-picker>
  13. <el-button
  14. type="primary"
  15. size="mini"
  16. :disabled="!selecList.length"
  17. @click="departureShipment"
  18. style="margin-right: 10px"
  19. >离港出运</el-button
  20. >
  21. <el-date-picker
  22. type="datetime"
  23. placeholder="选择到港时间"
  24. format="yyyy-MM-dd HH:mm"
  25. value-format="yyyy-MM-dd HH:mm"
  26. size="mini"
  27. v-model="arrival"
  28. style="margin-right: 10px"
  29. ></el-date-picker>
  30. <el-select
  31. v-model="fLoadportid"
  32. filterable
  33. clearable
  34. size="mini"
  35. placeholder="请选择港口"
  36. style="margin-right: 10px"
  37. >
  38. <el-scrollbar>
  39. <el-option
  40. v-for="(item, index) in fMblnoOptions"
  41. :key="index"
  42. :label="item.fName"
  43. :value="item.fId"
  44. ></el-option>
  45. </el-scrollbar>
  46. </el-select>
  47. <el-button
  48. type="primary"
  49. size="mini"
  50. :disabled="!selecList.length"
  51. @click="unloading"
  52. >到港卸船</el-button
  53. >
  54. </div>
  55. <el-table
  56. :data="dataList"
  57. ref="multipleTable"
  58. style="width: 100%"
  59. height="60vh"
  60. @selection-change="handleSelectionChange"
  61. >
  62. <el-table-column
  63. type="selection"
  64. fixed="left"
  65. align="center"
  66. ></el-table-column>
  67. <el-table-column
  68. prop="fMblno"
  69. label="提单号"
  70. :show-overflow-tooltip="true"
  71. />
  72. <el-table-column
  73. prop="corpName"
  74. label="客户名称"
  75. :show-overflow-tooltip="true"
  76. />
  77. <el-table-column
  78. prop="loadportName"
  79. label="起运港"
  80. :show-overflow-tooltip="true"
  81. />
  82. <el-table-column
  83. prop="destportName"
  84. label="目的港"
  85. :show-overflow-tooltip="true"
  86. />
  87. <el-table-column prop="fNo" label="箱型" :show-overflow-tooltip="true" />
  88. <el-table-column
  89. prop="fCntrcount"
  90. label="箱量"
  91. :show-overflow-tooltip="true"
  92. />
  93. <el-table-column
  94. prop="fConsigneername"
  95. label="收货人"
  96. :show-overflow-tooltip="true"
  97. />
  98. <el-table-column
  99. prop="createBy"
  100. label="发货人"
  101. :show-overflow-tooltip="true"
  102. />
  103. </el-table>
  104. <span slot="footer" class="dialog-footer">
  105. <el-button type="primary" @click="open = false">关闭</el-button>
  106. </span>
  107. </el-dialog>
  108. </template>
  109. <script>
  110. import { portInquiry } from "@/api/kaihe/domesticTrade/orderInformation";
  111. import { listBLNo,cargoStatus } from "@/api/kaihe/singleVoyageShip/index";
  112. export default {
  113. name: "BLNo",
  114. data() {
  115. return {
  116. open: false,
  117. dataList: [],
  118. selecList: [],
  119. fMblnoOptions: [],
  120. fLoadportid: null,
  121. departure: null,
  122. arrival: null,
  123. form: null,
  124. };
  125. },
  126. created() {
  127. portInquiry().then((res) => {
  128. this.fMblnoOptions = res.rows;
  129. });
  130. },
  131. methods: {
  132. init(row) {
  133. this.open = true;
  134. this.form = row;
  135. this.dataList = row.children;
  136. },
  137. handleSelectionChange(list) {
  138. this.selecList = list;
  139. },
  140. close() {
  141. this.$refs.multipleTable.clearSelection();
  142. this.dataList = [];
  143. this.fLoadportid = null;
  144. this.departure = null;
  145. this.arrival = null;
  146. this.form = null;
  147. },
  148. // 离港出运
  149. departureShipment() {
  150. let arr = [];
  151. this.selecList.forEach((e) => {
  152. arr.push(e.fMblno);
  153. });
  154. if (!this.departure) {
  155. return this.$message.error("离港时间未选择");
  156. }
  157. const data = {
  158. billList: arr,
  159. fUpdatetime: this.departure,
  160. updateStatus: "1",
  161. fVsl:this.selecList[0].vslName,
  162. fVoy:this.selecList[0].voyNo
  163. };
  164. cargoStatus(data).then((response) => {
  165. this.$emit("refresh");
  166. this.$alert("离港操作成功", "提示", {
  167. confirmButtonText: "确定",
  168. type: "success",
  169. callback: (action) => {
  170. this.$refs.multipleTable.clearSelection();
  171. },
  172. });
  173. });
  174. },
  175. // 到港卸船
  176. unloading() {
  177. let arr = [];
  178. this.selecList.forEach((e) => {
  179. arr.push(e.fMblno);
  180. });
  181. if (!this.arrival) {
  182. return this.$message.error("到港时间未选择");
  183. }
  184. // if (!this.fLoadportid) {
  185. // return this.$message.error("港口地点未选择");
  186. // }
  187. const data = {
  188. billList: arr,
  189. fUpdatetime: this.arrival,
  190. fUpdateaddress: this.fLoadportid,
  191. updateStatus: "2",
  192. };
  193. cargoStatus(data).then((response) => {
  194. this.$emit("refresh");
  195. let blNo = {
  196. fCargoPlanning: 0,
  197. fArrivalStatus: 3,
  198. fVslid: this.form.fVslid,
  199. fVoyid: this.form.fVoyid,
  200. };
  201. listBLNo(blNo).then((res) => {
  202. this.dataList= res.rows;
  203. });
  204. this.$alert("到港操作成功", "提示", {
  205. confirmButtonText: "确定",
  206. type: "success",
  207. callback: (action) => {
  208. this.$refs.multipleTable.clearSelection();
  209. },
  210. });
  211. });
  212. },
  213. },
  214. };
  215. </script>
  216. <style scoped></style>