saleOrderOODetails.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. //运输派单
  2. <template>
  3. <div class="transportOrder">
  4. <div class="transportOrder_top">
  5. <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
  6. <el-button type="primary" class="btn" @click="onclick">
  7. <i class="el-icon-search"></i>查询
  8. </el-button>
  9. <el-button type="primary" @click="back">
  10. <i class="el-icon-back"></i>返回
  11. </el-button>
  12. </div>
  13. <div>
  14. <el-dialog
  15. title="车辆信息"
  16. :visible.sync="dialogTableVisible"
  17. :before-close="handleClose"
  18. >
  19. <el-input style="width:250px" v-model="truckText"></el-input>
  20. <el-button type="primary" @click="getCapacity">查询</el-button>
  21. <dilTable
  22. v-bind.sync="truck"
  23. @radio-change="currentRadioChange1"
  24. ></dilTable>
  25. <span slot="footer" class="dialog-footer">
  26. <el-button @click="dialogTableVisible = false">取 消</el-button>
  27. <el-button type="primary" @click="updateTruckCapacity()"
  28. >确 定</el-button
  29. >
  30. </span>
  31. </el-dialog>
  32. </div>
  33. <div class="table">
  34. <mergeRowTable v-bind.sync="first" ref="table">
  35. <el-table-column fixed="right" label="操作" width="120">
  36. <template slot-scope="scope">
  37. <el-button
  38. @click="updateClick(scope)"
  39. type="text"
  40. size="small"
  41. v-if="
  42. scope.row.carStatus == '未接单' ||
  43. scope.row.carStatus == '未进厂'
  44. "
  45. >
  46. 修改
  47. </el-button>
  48. <el-button @click="deleteClick(scope)" type="text" size="small">
  49. 关闭
  50. </el-button>
  51. </template>
  52. </el-table-column>
  53. </mergeRowTable>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. import { getCookie } from '@/utils/util.js'
  59. export default {
  60. data() {
  61. return {
  62. carrierUserId: '',
  63. //模态窗的框计算
  64. inputText: null,
  65. //车辆输入框
  66. truckText: null,
  67. //是否弹出对话框
  68. dialogTableVisible: false,
  69. //输入框的值
  70. input: '',
  71. //选项卡的当前选中的值
  72. activeName: 'first',
  73. //已下发的表格
  74. first: {
  75. requestUrl: '',
  76. comparison: 'orderNumber',
  77. orderNumber: [0, 1]
  78. },
  79. //车辆信息的表格
  80. truck: {
  81. requestUrl: '',
  82. // 控制显示当选列
  83. selectionType: 'radio'
  84. },
  85. //当前选中的订单id
  86. selectOrderId: null,
  87. //选中的车辆号
  88. capacityNumber: '',
  89. //选中的运力id
  90. capacityId: null,
  91. //是否关闭模态框
  92. drawer: false,
  93. //模态框从左往右打开
  94. direction: 'rtl',
  95. orderId: null,
  96. //区别点击的是添加运力,还是修改
  97. index: null
  98. }
  99. },
  100. created() {
  101. this.truck.requestUrl = '/api/v1/uc/getAllCapacityByCarrierLike?apiId=429'
  102. this.first.requestUrl =
  103. '/api/v1/oms/getDriverInfoForSale2?apiId=484&orderStatus=4' +
  104. '&saleOrderId=' +
  105. this.$route.params.saleOrderId
  106. },
  107. methods: {
  108. onclick() {
  109. this.first.requestUrl =
  110. '/api/v1/oms/getDriverInfoForSale2?apiId=484&orderStatus=4' +
  111. '&saleOrderId=' +
  112. this.$route.params.saleOrderId +
  113. '&con=' +
  114. this.input +
  115. '&i=' +
  116. new Date()
  117. },
  118. back() {
  119. this.$router.go(-1)
  120. },
  121. handleClose(done) {
  122. done()
  123. this.$message.info('取消修改运力')
  124. },
  125. getRequestUrl() {
  126. this.first.requestUrl =
  127. '/api/v1/oms/getDriverInfoForSale2?apiId=484&orderStatus=4' +
  128. '&saleOrderId=' +
  129. this.$route.params.saleOrderId +
  130. '&i=' +
  131. new Date()
  132. },
  133. getTruckRequestUrl() {
  134. this.truck.requestUrl =
  135. '/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=' +
  136. null +
  137. '&i=' +
  138. new Date()
  139. },
  140. currentRadioChange1(row) {
  141. console.log(row)
  142. this.capacityId = row.capacityId
  143. },
  144. //删除运输订单
  145. deleteClick(scope) {
  146. console.log(scope.row.orderNumber)
  147. let orderId = scope.row.orderNumber.substring(15)
  148. console.log(orderId)
  149. let map = {
  150. orderId: scope.row.orderId || orderId,
  151. userId: getCookie('userId')
  152. }
  153. this.$confirm('是否删除?', '提示', {
  154. confirmButtonText: '确定',
  155. cancelButtonText: '取消',
  156. type: 'warning'
  157. })
  158. .then(() => {
  159. this.axios.post('/api/v1/oms/closeOmstruckOrder', map).then(res => {
  160. if (res.data.code == 200) {
  161. this.$message({
  162. type: 'success',
  163. message: '删除成功!'
  164. })
  165. this.getRequestUrl()
  166. } else {
  167. this.$message({
  168. message: '删除失败',
  169. type: 'warning'
  170. })
  171. }
  172. })
  173. })
  174. .catch(() => {
  175. this.$message({
  176. type: 'info',
  177. message: '已取消删除'
  178. })
  179. })
  180. },
  181. //修改运输订单
  182. updateClick(scope) {
  183. this.getTruckRequestUrl()
  184. this.orderId = scope.row.orderId
  185. this.dialogTableVisible = true
  186. console.log(scope.row.orderId)
  187. },
  188. updateTruckCapacity() {
  189. if (this.capacityId == null) {
  190. this.$message.error('未选中运力')
  191. return
  192. }
  193. this.axios
  194. .post('/api/v1/oms/updateCapacityId', {
  195. capacityId: this.capacityId,
  196. orderId: this.orderId
  197. })
  198. .then(res => {
  199. if (res.data.code == '200') {
  200. this.$message.success('修改运力成功')
  201. this.getRequestUrl()
  202. this.dialogTableVisible = false
  203. } else {
  204. this.$message.error('修改运力失败')
  205. }
  206. })
  207. },
  208. handleClick(tab, event) {
  209. this.getRequestUrl()
  210. },
  211. Insert() {
  212. this.$router.push('addOldSporadicOrder')
  213. },
  214. getCapacity() {
  215. if (this.truckText != null) {
  216. if (getCookie('orgCode') == 'chengyunshang') {
  217. this.truck.requestUrl =
  218. '/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=' +
  219. getCookie('userId') +
  220. '&index=' +
  221. this.truckText
  222. } else {
  223. this.truck.requestUrl =
  224. '/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=' +
  225. null +
  226. '&index=' +
  227. this.truckText
  228. }
  229. this.truckText = null
  230. } else {
  231. if (getCookie('orgCode') == 'chengyunshang') {
  232. this.truck.requestUrl =
  233. '/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=' +
  234. getCookie('userId') +
  235. '&i=' +
  236. new Date()
  237. } else {
  238. this.truck.requestUrl =
  239. '/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=' +
  240. null +
  241. '&i=' +
  242. new Date()
  243. }
  244. }
  245. }
  246. }
  247. }
  248. </script>
  249. <style lang="scss">
  250. .transportOrder {
  251. .transportOrder_top {
  252. width: 100%;
  253. height: 100px;
  254. display: flex;
  255. align-items: center;
  256. padding-left: 50px;
  257. .el-input {
  258. width: 20%;
  259. }
  260. }
  261. .drawer_top {
  262. width: 100%;
  263. height: 50px;
  264. padding-left: 20px;
  265. display: flex;
  266. align-items: center;
  267. }
  268. .table {
  269. margin-left: 30px;
  270. margin-top: 10px;
  271. }
  272. }
  273. </style>