indexItem.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. };
  162. cargoStatus(data).then((response) => {
  163. this.$emit("refresh");
  164. this.$alert("离港操作成功", "提示", {
  165. confirmButtonText: "确定",
  166. type: "success",
  167. callback: (action) => {
  168. this.$refs.multipleTable.clearSelection();
  169. },
  170. });
  171. });
  172. },
  173. // 到港卸船
  174. unloading() {
  175. let arr = [];
  176. this.selecList.forEach((e) => {
  177. arr.push(e.fMblno);
  178. });
  179. if (!this.arrival) {
  180. return this.$message.error("到港时间未选择");
  181. }
  182. // if (!this.fLoadportid) {
  183. // return this.$message.error("港口地点未选择");
  184. // }
  185. const data = {
  186. billList: arr,
  187. fUpdatetime: this.arrival,
  188. fUpdateaddress: this.fLoadportid,
  189. updateStatus: "2",
  190. };
  191. cargoStatus(data).then((response) => {
  192. this.$emit("refresh");
  193. let blNo = {
  194. fCargoPlanning: 0,
  195. fArrivalStatus: 3,
  196. fVslid: this.form.fVslid,
  197. fVoyid: this.form.fVoyid,
  198. };
  199. listBLNo(blNo).then((res) => {
  200. this.dataList= res.rows;
  201. });
  202. this.$alert("到港操作成功", "提示", {
  203. confirmButtonText: "确定",
  204. type: "success",
  205. callback: (action) => {
  206. this.$refs.multipleTable.clearSelection();
  207. },
  208. });
  209. });
  210. },
  211. },
  212. };
  213. </script>
  214. <style scoped></style>