billLading.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <div>
  3. <el-dialog title="客户订舱" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
  4. <span>
  5. <trade-card title="基础信息">
  6. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm" :disabled="true">
  7. <el-row>
  8. <el-col span="12">
  9. <el-row>
  10. <el-col span="12">
  11. <el-row>
  12. <el-form-item label="发货人" prop="hshipperDetails">
  13. <el-input type="textarea" style="width: 100%;"
  14. v-model="form.detail.hshipperDetails" size="small"
  15. autocomplete="off" :disabled="true" :rows="3" clearable></el-input>
  16. </el-form-item>
  17. </el-row>
  18. <el-row>
  19. <el-form-item label="收货人" prop="hconsigneeDetails">
  20. <el-input type="textarea" style="width: 100%;"
  21. v-model="form.detail.hconsigneeDetails" size="small"
  22. autocomplete="off" :disabled="true" :rows="3" clearable></el-input>
  23. </el-form-item>
  24. </el-row>
  25. <el-row>
  26. <el-form-item label="通知人" prop="hnotifyDetails">
  27. <el-input type="textarea" style="width: 100%;"
  28. v-model="form.detail.hnotifyDetails" size="small" autocomplete="off"
  29. :disabled="true" :rows="3" clearable></el-input>
  30. </el-form-item>
  31. </el-row>
  32. </el-col>
  33. <el-col span="12">
  34. <el-row>
  35. <el-form-item label="唛头" prop="marks">
  36. <el-input type="textarea" style="width: 100%;" v-model="form.marks"
  37. size="small" autocomplete="off" :disabled="true" :rows="5"
  38. clearable></el-input>
  39. </el-form-item>
  40. </el-row>
  41. <el-row>
  42. <el-form-item label="货物" prop="commodityDescr">
  43. <el-input type="textarea" style="width: 100%;"
  44. v-model="form.commodityDescr" size="small" autocomplete="off"
  45. :disabled="true" :rows="5" clearable></el-input>
  46. </el-form-item>
  47. </el-row>
  48. </el-col>
  49. </el-row>
  50. </el-col>
  51. <el-col span="12">
  52. <el-row>
  53. <el-col span="12">
  54. <el-form-item label="装货港" prop="polCnName">
  55. <el-input style="width: 100%;" v-model="form.polCnName" size="small"
  56. :disabled="true"></el-input>
  57. </el-form-item>
  58. </el-col>
  59. <el-col span="12">
  60. <el-form-item label="卸货港" prop="podCnName">
  61. <el-input style="width: 100%;" v-model="form.podCnName" size="small"
  62. :disabled="true"></el-input>
  63. </el-form-item>
  64. </el-col>
  65. </el-row>
  66. <el-row>
  67. <el-col span="12">
  68. <el-form-item label="ETD" prop="etd">
  69. <el-date-picker v-model="form.etd" type="date" placeholder="请选择 ETD"
  70. :disabled="true" size="small" format="yyyy-MM-dd"
  71. value-format="yyyy-MM-dd" style="width: 100%;">
  72. </el-date-picker>
  73. </el-form-item>
  74. </el-col>
  75. </el-row>
  76. <el-row>
  77. <el-col span="12">
  78. <el-form-item label="付款方式" prop="mpaymode">
  79. <el-input style="width: 100%;" v-model="form.mpaymode" size="small"
  80. :disabled="true"></el-input>
  81. </el-form-item>
  82. </el-col>
  83. <el-col span="12">
  84. <el-form-item label="运输条款" prop="serviceTerms">
  85. <el-input style="width: 100%;" v-model="form.serviceTerms" size="small"
  86. :disabled="true"></el-input>
  87. </el-form-item>
  88. </el-col>
  89. </el-row>
  90. <el-row>
  91. <el-col span="12">
  92. <el-form-item label="件数" prop="quantity">
  93. <el-input style="width: 100%;" v-model="form.quantity" size="small"
  94. :disabled="true"></el-input>
  95. </el-form-item>
  96. </el-col>
  97. <el-col span="12">
  98. <el-form-item label="包装" prop="packingUnit">
  99. <el-input style="width: 100%;" v-model="form.packingUnit" size="small"
  100. :disabled="true"></el-input>
  101. </el-form-item>
  102. </el-col>
  103. </el-row>
  104. <el-row>
  105. <el-col span="12">
  106. <el-form-item label="毛重(KGS)" prop="grossWeight">
  107. <el-input style="width: 100%;" v-model="form.grossWeight" size="small"
  108. :disabled="true"></el-input>
  109. </el-form-item>
  110. </el-col>
  111. <el-col span="12">
  112. <el-form-item label="尺码(CBM)" prop="measurement">
  113. <el-input style="width: 100%;" v-model="form.measurement" size="small"
  114. :disabled="true"></el-input>
  115. </el-form-item>
  116. </el-col>
  117. </el-row>
  118. </el-col>
  119. </el-row>
  120. </el-form>
  121. </trade-card>
  122. <trade-card title="配箱信息">
  123. <avue-crud :option="option" :table-loading="loading" :data="form.containersList" v-model="form"
  124. id="out-table" :header-cell-class-name="headerClassName" ref="crud"
  125. :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }">
  126. </avue-crud>
  127. </trade-card>
  128. </span>
  129. <span slot="footer" class="dialog-footer">
  130. <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
  131. <el-button type="primary" @click="submit" size="mini">导 入</el-button>
  132. </span>
  133. </el-dialog>
  134. </div>
  135. </template>
  136. <script>
  137. import { getDetail } from "@/api/iosBasicData/businessCenter/bookingCabin.js";
  138. import { billLadingConfirm } from '@/api/iosBasicData/bills'
  139. export default {
  140. props: {
  141. oldForm: {
  142. type: Object,
  143. default: () => { }
  144. },
  145. },
  146. data() {
  147. return {
  148. form: {},
  149. dialogVisible: false,
  150. option: {
  151. height: '200',
  152. calcHeight: 30,
  153. header: false,
  154. menu: false,
  155. column: [
  156. {
  157. label: "箱型",
  158. prop: "cntrTypeCode",
  159. width: "100",
  160. },
  161. {
  162. label: "箱号",
  163. prop: "cntrNo",
  164. width: "140",
  165. overHidden: true,
  166. },
  167. {
  168. label: "封号",
  169. prop: "sealNo",
  170. width: "140",
  171. overHidden: true,
  172. },
  173. {
  174. label: "件数",
  175. prop: "quantity",
  176. width: "100",
  177. },
  178. {
  179. label: "毛重(KGM)",
  180. prop: "grossWeight",
  181. width: "120",
  182. },
  183. {
  184. label: "尺码/体积(CBM)",
  185. prop: "measurement",
  186. width: "140",
  187. },
  188. {
  189. label: "箱皮重",
  190. prop: "tare",
  191. width: "140",
  192. overHidden: true,
  193. },
  194. {
  195. label: "VGM总重(KGM)",
  196. prop: "vgmWeight",
  197. width: "140",
  198. overHidden: true,
  199. },
  200. {
  201. label: "备注",
  202. prop: "remarks",
  203. type: 'textarea',
  204. width: 180,
  205. slot: true,
  206. minRows: 3,
  207. span: 24,
  208. },
  209. {
  210. label: "POD堆场",
  211. prop: "podStationCname",
  212. width: "140",
  213. },
  214. ]
  215. },
  216. }
  217. },
  218. async created() {
  219. // this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
  220. },
  221. methods: {
  222. openDialog(id) {
  223. this.dialogVisible = true
  224. const obj = {
  225. id: id,
  226. confirmStatus: 1
  227. }
  228. const loading = this.$loading({
  229. lock: true,
  230. text: '加载中',
  231. spinner: 'el-icon-loading',
  232. background: 'rgba(255,255,255,0.7)'
  233. });
  234. getDetail(obj).then(res => {
  235. this.form = res.data.data
  236. }).finally(() => {
  237. loading.close()
  238. })
  239. },
  240. submit() {
  241. let text = []
  242. if (this.form.polCnName != this.oldForm.polCnName) {
  243. text.push('装货港')
  244. }
  245. if (this.form.podCnName != this.oldForm.podCnName) {
  246. text.push('卸货港')
  247. }
  248. if (this.form.quantity != this.oldForm.quantity) {
  249. text.push('件数')
  250. }
  251. if (this.form.grossWeight != this.oldForm.grossWeight) {
  252. text.push('毛重')
  253. }
  254. if (this.form.measurement != this.oldForm.measurement) {
  255. text.push('尺码')
  256. }
  257. if (text.length) {
  258. this.$confirm(`${text.join(",")}是否需要覆盖?`, '提示', {
  259. confirmButtonText: '确定',
  260. cancelButtonText: '取消',
  261. type: 'warning'
  262. }).then(() => {
  263. const loading = this.$loading({
  264. lock: true,
  265. text: '加载中',
  266. spinner: 'el-icon-loading',
  267. background: 'rgba(255,255,255,0.7)'
  268. });
  269. billLadingConfirm(this.oldForm).then(res => {
  270. this.$message.success("操作成功");
  271. this.dialogVisible = false
  272. this.$emit('upDate')
  273. }).finally(() => {
  274. loading.close()
  275. })
  276. })
  277. } else {
  278. const loading = this.$loading({
  279. lock: true,
  280. text: '加载中',
  281. spinner: 'el-icon-loading',
  282. background: 'rgba(255,255,255,0.7)'
  283. });
  284. billLadingConfirm(this.oldForm).then(res => {
  285. this.$message.success("操作成功");
  286. this.dialogVisible = false
  287. this.$emit('upDate')
  288. }).finally(() => {
  289. loading.close()
  290. })
  291. }
  292. },
  293. //自定义列保存
  294. async saveColumn(ref, option, optionBack, code) {
  295. /**
  296. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  297. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  298. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  299. */
  300. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  301. if (inSave) {
  302. this.$message.success("保存成功");
  303. //关闭窗口
  304. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  305. this.searchReset()
  306. }
  307. },
  308. //自定义列重置
  309. async resetColumn(ref, option, optionBack, code) {
  310. this[option] = this[optionBack];
  311. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  312. if (inSave) {
  313. this.$message.success("重置成功");
  314. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  315. }
  316. },
  317. // 更改表格颜色
  318. headerClassName(tab) {
  319. //颜色间隔
  320. let back = ""
  321. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  322. if (tab.columnIndex % 2 === 0) {
  323. back = "back-one"
  324. } else if (tab.columnIndex % 2 === 1) {
  325. back = "back-two"
  326. }
  327. }
  328. return back;
  329. },
  330. }
  331. }
  332. </script>
  333. <style lang="scss" scoped>
  334. ::v-deep#out-table .back-one {
  335. background: #ecf5ff !important;
  336. text-align: center;
  337. padding: 4px 0;
  338. }
  339. ::v-deep#out-table .back-two {
  340. background: #ecf5ff !important;
  341. text-align: center;
  342. padding: 4px 0;
  343. }
  344. ::v-deep .el-form-item__error {
  345. display: none !important;
  346. }
  347. ::v-deep .el-form-item {
  348. margin-bottom: 8px !important;
  349. }
  350. ::v-deep .el-dialog__body {
  351. padding: 0px 20px !important;
  352. }
  353. </style>