editCapacity.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2.  
  3. <!-- 修改运力信息 -->
  4. <div class="editCapacity">
  5.  
  6. <div id="contractDetails">
  7.     <page-title>编辑</page-title>    
  8. <div class="main">   </div>
  9.    
  10. <div class="contractTitle">
  11.      
  12. <div class="form_box" style="margin-right: 10rem">
  13.           <dil-form :formId="380" v-model="form1"></dil-form>      
  14. </div>
  15.    
  16. </div>
  17. <!-- <div class="elForm">
  18. <el-form
  19. :inline="true"
  20. class="demo-form-inline"
  21. label-width="80px"
  22. >
  23. <el-form-item label="选择承运商">
  24. <el-autocomplete
  25. class="inline-input"
  26. v-model="state"
  27. :fetch-suggestions="querySearch"
  28. placeholder="请输入承运商名称"
  29. :trigger-on-focus="false"
  30. @select="handleSelect"
  31. >
  32. <template slot-scope="{ item }">
  33. <div class="name">{{ item.carrierName }}</div>
  34. </template>
  35. </el-autocomplete>
  36. </el-form-item>
  37. </el-form> -->
  38. <!-- </div> -->
  39. </div>
  40.    
  41. <div class="button_box">
  42.       <el-button type="primary" @click="onClickConfirm">确认</el-button>  
  43.  
  44. </div>
  45.  
  46. </div>
  47. </template>
  48. <script>
  49. import PageTitle from "@/components/Page/Title";
  50. import { getCookie } from "@/utils/util.js";
  51. export default {
  52. components: { PageTitle },
  53. data() {
  54. return {
  55. state: "",
  56. userId: null,
  57. restaurants: [],
  58. accessToken: null,
  59. userCode: null,
  60. carrierUserId: null,
  61. carrierId: null,
  62. capacityCarrierId:null,
  63. carrierIds: null,
  64. direction: "rtl",
  65. inputText: "",
  66. form1: {},
  67. carrierUserId: null,
  68. carrierName: "",
  69. map:[],
  70. options: {
  71. requestUrl: "/api/v1/rms/getCarrierList?apiId=417",
  72. selectionType: "radio",
  73. mapList: [],
  74. },
  75. };
  76. },
  77. // created(){
  78. // this.carrierUserId = getCookie("userId");
  79. // // console.log(this.carrierUserId ,'carrierUserId')
  80. // },
  81. mounted() {
  82. this.information();
  83. },
  84. // mounted() {
  85. //    this.information();
  86. // this.axios.post(
  87. // "/api/v1/rms/getCarrierNameBySSOId?carrierSSOId=" + this.carrierUserId
  88. // )
  89. // .then((res) => {
  90. // if(res.data.code == "200"){
  91. // console.log(res.data.data)
  92. // this.state = res.data.data.carrierName
  93. // this.carrierIds = res.data.data.carrierId
  94. // }
  95. // })},
  96. methods: {
  97. //承运商弹出层
  98. // handleSelect(item){
  99. // this.carrierIds = item.carrierId
  100. // item.carrierName = this.state
  101. // },
  102. // //以下是承运商边输边查搜索
  103. // querySearch(queryString, cb) {
  104. // this.axios.post('/api/v1/uc/getCarrierMesByLike?index='+queryString).then((res)=>{
  105. // if(res.data.code == "200"){
  106. // console.log(res.data.data)
  107. // var restaurants = res.data.data
  108. // console.log(restaurants,"restaurants");
  109. // var results = queryString ? restaurants.filter(this.createFilter(queryString)) :restaurants;
  110. // // 调用 callback 返回建议列表的数据
  111. // cb(results);
  112. // }
  113. // })
  114. // },
  115. // createFilter(queryString) {
  116. // return (restaurants) => {
  117. // return (restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
  118. // };
  119. // },
  120. // //以上是承运商边输边查搜索
  121. // currentRadioChange(selection){
  122. // this.mapList=selection,
  123. // // console.log(this.mapList)
  124. // this.carrierName=this.mapList.carrierName
  125. // },
  126. // onclick(){
  127. // this.options.requestUrl="/api/v1/rms/getCarrierList?apiId=417&con=" +this.inputText;
  128. // },
  129. information() {
  130. //       //编辑
  131. // console.log(this.$route.params)
  132. // console.log(this.$route.params)
  133. this.axios
  134. .post(
  135. "/api/v1/rms/getCapacityInfoById/" +
  136. this.$route.params.capacityCarrierId
  137. )
  138. .then((res) => {
  139. console.log(res);
  140. res.data.data.forEach((e) => {
  141. console.log("from", this.form1);
  142. this.form1 = e;
  143. });
  144. });
  145. }, // 返回
  146. onClickCancel() {
  147. this.$router.go(-1);
  148. }, // 确认
  149. onClickConfirm() {
  150. console.log(this.form1);
  151. let map = {
  152. remark: this.form1.remark,
  153. userDep:this.form1.userDep,
  154. capacityCarrierId:this.$route.params.capacityCarrierId
  155. };
  156. if (
  157. map.remark == null ||
  158. map.userDep == null
  159. )
  160. this.$message.error("不能存在空值");
  161. else
  162. this.axios.post("/api/v1/rms/updateCapacity", map).then((res) => {
  163. if (res.data.code == "200") {
  164. this.$message.success("修改成功");
  165. this.$router.go(-1);
  166. }else{
  167. this.$message.success("修改失败");
  168. this.$router.go(-1);
  169. }
  170. });
  171. },
  172. },
  173. };
  174. </script>
  175. <style lang='scss' scoped>
  176. .editCapacity {
  177. .elForm {
  178. margin-left: 40%;
  179. }
  180. .form_box {
  181. width: 100%;
  182. margin-top: 30px;
  183. display: flex;
  184. justify-content: center;
  185. .el-form-item {
  186. display: flex;
  187. justify-content: center;
  188. .el-form-item__label {
  189. display: flex;
  190. align-items: center;
  191. }
  192. .el-form-item__content {
  193. .el-select {
  194. width: 250px;
  195. }
  196. .el-input {
  197. width: 250px;
  198. }
  199. }
  200. }
  201. }
  202. .button_box {
  203. display: flex;
  204. justify-content: center;
  205. .el-button {
  206. width: 80px;
  207. margin-right: 10px;
  208. }
  209. }
  210. .disableBox {
  211. display: flex;
  212. text-align: center;
  213. align-items: center;
  214. justify-content: center;
  215. margin-top: 1.5rem;
  216. margin-bottom: 1.25rem;
  217. }
  218. }
  219. </style>