editCapacity.vue 7.0 KB

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