index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div class="pageBack">
  3. <div class="gradient-background">
  4. <el-form ref="query" :model="query" label-width="90px">
  5. <el-row>
  6. <el-col :span="8">
  7. <el-form-item label="Release Ref">
  8. <el-input class="rounded-input" v-model="query.containerNumber" clearable></el-input>
  9. </el-form-item>
  10. </el-col>
  11. <el-col :span="8">
  12. <el-form-item label="Container">
  13. <el-input class="rounded-input" v-model="query.code" clearable></el-input>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="8">
  17. <div style="display: flex;justify-content: flex-end;">
  18. <el-button type="primary" round @click="search">Search</el-button>
  19. <el-button type="success" round @click="openReport">Download</el-button>
  20. <el-button v-if="roleName.includes('admin')" type="danger" round @click="designReport">Design Report</el-button>
  21. </div>
  22. </el-col>
  23. </el-row>
  24. </el-form>
  25. </div>
  26. <div style="padding: 20px;">
  27. <el-form ref="form" :model="form" label-width="90px">
  28. <el-row>
  29. <el-col :span="8">
  30. <el-form-item label="Type/Quantity">
  31. <el-input class="rounded-input" v-model="form.boxTypeQuantityOne" readonly></el-input>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="4">
  35. <el-form-item label="Picked-up">
  36. <el-input class="rounded-input" v-model="form.suitcaseNum" readonly></el-input>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="4">
  40. <el-form-item label="Await">
  41. <el-input class="rounded-input" v-model="form.notSuitcaseNum" readonly></el-input>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="8">
  45. <el-form-item label="Condition">
  46. <el-input class="rounded-input" v-model="form.boxCondition" readonly></el-input>
  47. </el-form-item>
  48. </el-col>
  49. </el-row>
  50. <el-row>
  51. <el-col :span="8">
  52. <el-form-item label="POL">
  53. <el-input class="rounded-input" v-model="form.polCname" readonly></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="8">
  57. <el-form-item label="POD">
  58. <el-input class="rounded-input" v-model="form.podCname" readonly></el-input>
  59. </el-form-item>
  60. </el-col>
  61. </el-row>
  62. </el-form>
  63. </div>
  64. <div style="padding:0 20px 20px 20px;">
  65. <avue-crud class="diy_table" :option="option" :data="form.tradingBoxItemsList"> </avue-crud>
  66. </div>
  67. <report ref="report" :id="form.id" businessValue="OW-N" classifyCode="动态查询"></report>
  68. <reports :id="form.id" :assemblyForm="form" businessValue="OW-N" ref="reports"></reports>
  69. </div>
  70. </template>
  71. <script>
  72. import { containerDynamicInquiry } from "@/api/iosBasicData/boxDynamic.js";
  73. import report from "./components/report.vue";
  74. import reports from "@/components/boxManagement/reports.vue";
  75. export default {
  76. name: "箱动态查询",
  77. components: { report,reports },
  78. data() {
  79. return {
  80. roleName: localStorage.getItem("roleName"),
  81. query: {},
  82. form: {
  83. tradingBoxItemsList: []
  84. },
  85. option: {
  86. header: false,
  87. menu: false,
  88. align: "center",
  89. headerAlign: "center",
  90. border: true,
  91. index: true,
  92. indexLabel: "Serial",
  93. indexWidth: 60,
  94. stripe: true,
  95. emptyText: "No Data",
  96. maxHeight: 600,
  97. column: [
  98. {
  99. label: "Container",
  100. prop: "code",
  101. overHidden: true
  102. },
  103. {
  104. label: "Type",
  105. prop: "boxType",
  106. overHidden: true
  107. },
  108. {
  109. label: "POL Depot",
  110. prop: "polCyCname",
  111. overHidden: true
  112. },
  113. {
  114. label: "Gate Out",
  115. prop: "polPreAppearanceDate",
  116. overHidden: true
  117. },
  118. {
  119. label: "ETD",
  120. prop: "etd",
  121. overHidden: true
  122. },
  123. {
  124. label: "ATD",
  125. prop: "actualEtd",
  126. type: "date",
  127. format: "yyyy-MM-dd",
  128. valueFormat: "yyyy-MM-dd HH:mm:ss",
  129. overHidden: true
  130. },
  131. {
  132. label: "ETA",
  133. prop: "eta",
  134. overHidden: true
  135. },
  136. {
  137. label: "ATA",
  138. prop: "actualEta",
  139. overHidden: true
  140. },
  141. {
  142. label: "Gatein",
  143. prop: "podEmptyContainerReturnDate",
  144. overHidden: true
  145. },
  146. {
  147. label: "POD Depot",
  148. prop: "podStationCname",
  149. overHidden: true
  150. },
  151. {
  152. label: "Days In Use",
  153. prop: "podBoxUseDays",
  154. overHidden: true
  155. }
  156. ]
  157. }
  158. };
  159. },
  160. created() {},
  161. methods: {
  162. openReport() {
  163. if (!this.form.id) {
  164. return this.$message.error("未查询数据,不允许打开报表!");
  165. }
  166. this.$refs.report.openDialog();
  167. },
  168. designReport() {
  169. if (!this.form.id) {
  170. return this.$message.error("未查询数据,不允许打开设计报表!");
  171. }
  172. this.$refs.reports.openDialog();
  173. },
  174. search() {
  175. if (!this.query.containerNumber) {
  176. return this.$message.error("Please enter Release Ref!");
  177. }
  178. const loading = this.$loading({
  179. lock: true,
  180. text: "loading",
  181. spinner: "el-icon-loading",
  182. background: "rgba(255,255,255,0.7)"
  183. });
  184. containerDynamicInquiry(this.query)
  185. .then(res => {
  186. this.form = res.data.data;
  187. })
  188. .finally(() => {
  189. loading.close();
  190. });
  191. }
  192. }
  193. };
  194. </script>
  195. <style lang="scss" scoped>
  196. .pageBack {
  197. background-color: #ffffff;
  198. width: 100%;
  199. height: 100%;
  200. }
  201. .gradient-background {
  202. /* 背景渐变效果,从右上角到左下角 */
  203. background: linear-gradient(to bottom left, #a1d1fe, #ffffff);
  204. padding: 42px 20px 20px 20px;
  205. }
  206. .rounded-input ::v-deep .el-input__inner {
  207. border-radius: 20px !important; /* 使用 !important 确保覆盖默认样式 */
  208. }
  209. .el-form ::v-deep .el-form-item__label {
  210. font-weight: 700;
  211. font-size: 20px;
  212. color: #606266;
  213. }
  214. .avue-crud ::v-deep .el-table th {
  215. color: #ffffff;
  216. background-color: #001e63;
  217. }
  218. </style>