addShipmentInstructions.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <!-- 装船指令新增页面 -->
  3. <div class="shipTransport">
  4. <page-title>返回</page-title>
  5. <div class="form">
  6. <div class="form_box">
  7. <dil-form :formId="114" v-model="form1" ref="from1"></dil-form>
  8. </div>
  9. <div class="liulan">
  10. <el-button type="primary" class="btn" @click="onDrawer">浏览</el-button>
  11. </div>
  12. </div>
  13. <!-- 确定和取消 -->
  14. <div class="button_box">
  15. <el-button @click="cancel">取消</el-button>
  16. <el-button type="primary" @click="makeSure">确定</el-button>
  17. </div>
  18. <!-- 模态框 -->
  19. <el-drawer
  20. :visible.sync="drawer"
  21. :direction="direction"
  22. :before-close="handleClose"
  23. size="35%"
  24. >
  25. <el-input placeholder="请输入内容" v-model="input" style="margin-top:10px;margin-left:20px;width:250px" clearable> </el-input>
  26. <el-button type="primary" class="btn" @click="onclick()" style="margin-bottom:15px">
  27. <i class="el-icon-search"></i>查询
  28. </el-button>
  29. <dilTable v-bind.sync="options" @radio-change="currentRadioChange1" ></dilTable>
  30. </el-drawer>
  31. </div>
  32. </template>
  33. <script>
  34. import PageTitle from "@/components/Page/Title";
  35. import { sjTime,isNumber } from "@/utils/sharedJsFile";
  36. export default {
  37. components: { PageTitle },
  38. data() {
  39. return {
  40. drawer:false,
  41. direction:"rtl",
  42. input:'',
  43. options:{
  44. requestUrl:"/api/v1/tms/getBatchListForAttorney?apiId=383",
  45. selectionType:"radio",
  46. maplist:[]
  47. },
  48. form1: {},
  49. value: undefined,
  50. };
  51. },
  52. mounted() {},
  53. methods: {
  54. onDrawer(){
  55. this.drawer = true
  56. },
  57. onclick(){
  58. this.options.requestUrl = "/api/v1/tms/getBatchList?apiId=383&con=" + this.input
  59. },
  60. currentRadioChange1(selection){
  61. this.maplist = selection
  62. this.form1 = {
  63. batchId:selection.resultForeignShipName + selection.materialName
  64. }
  65. },
  66. handleClose(done){
  67. done();
  68. },
  69. // 确定
  70. makeSure() {
  71. let omsshipShipmentInstructions = {
  72. batchId: this.maplist.batchId,
  73. instructionsTotalTonnage: this.form1.instructionsTotalTonnage,
  74. instructionTime: sjTime(
  75. this.form1.instructionTime
  76. ),
  77. };
  78. console.log(
  79. omsshipShipmentInstructions
  80. );
  81. if (
  82. omsshipShipmentInstructions.batchId==null||
  83. omsshipShipmentInstructions.instructionsTotalTonnage==null||
  84. omsshipShipmentInstructions.instructionTime==null
  85. ) this.$message.error("存在空值!");
  86. else
  87. this.axios
  88. .post(
  89. "/api/v1/tms/addShipmentInstructions",
  90. omsshipShipmentInstructions
  91. )
  92. .then((res) => {
  93. // console.log(res);
  94. // console.log(this.form4);
  95. this.$router.go(-1);
  96. });
  97. },
  98. // 取消
  99. cancel() {
  100. this.$router.go(-1);
  101. },
  102. },
  103. };
  104. </script>
  105. <style lang="scss">
  106. .shipTransport{
  107. .form{
  108. display: flex;
  109. .form_box{
  110. width: 320px;
  111. margin-left: 35%;
  112. margin-top: 30px;
  113. margin-right: 20px;
  114. .el-form{
  115. .preview-group{
  116. .el-form-item{
  117. .el-form-item__label{
  118. display: inline-block;
  119. width: 70px !important;
  120. }
  121. .el-form-item__content{
  122. .el-select{
  123. width: 250px;
  124. }
  125. .el-input{
  126. width: 250px;
  127. }
  128. }
  129. }
  130. }
  131. }
  132. }
  133. }
  134. .liulan{
  135. width: 120px;
  136. margin-top: 30px;
  137. .el-button{
  138. width: 100px !important;
  139. margin: auto;
  140. }
  141. .btn{
  142. margin-top: 0px;
  143. }
  144. .btn1{
  145. margin-top: 13px;
  146. }
  147. .btn2{
  148. margin-top: 67px;
  149. }
  150. }
  151. .button_box{
  152. margin-left: 45%;
  153. }
  154. }
  155. </style>