capacity.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. //资源管理运力
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <el-input placeholder="请输入内容" v-model="textInput" clearable>
  6. </el-input>
  7. <el-button
  8. type="primary"
  9. class="btn"
  10. @click="onclick"
  11. :loading="selectLoading"
  12. >
  13. <i class="el-icon-search"></i>查询
  14. </el-button>
  15. <el-button type="primary" class="btn" @click="toInsert">
  16. <i class="el-icon-plus"></i>新增
  17. </el-button>
  18. <el-button type="primary" class="btn" @click="toInsert1">
  19. <i class="el-icon-plus"></i>新增特殊车牌
  20. </el-button>
  21. <el-button type="primary" @click="exportData()"
  22. ><i class="el-icon-download"></i>导出(Excel)</el-button
  23. >
  24. </div>
  25. <div class="table">
  26. <dilTable
  27. ref="excelDom"
  28. v-bind.sync="options"
  29. :loading="tableloading"
  30. @func="func"
  31. :isKuang="isKuang"
  32. >
  33. <el-table-column fixed="right" label="操作" width="100">
  34. <template slot-scope="scope">
  35. <el-button
  36. type="text"
  37. size="small"
  38. @click="updateCapacity(scope.row.capacityCarrierId)"
  39. >
  40. 修改备注
  41. </el-button>
  42. <el-button
  43. type="text"
  44. size="small"
  45. @click="deleteCapacity(scope.row)"
  46. v-if="show == true"
  47. >
  48. 删除
  49. </el-button>
  50. <el-button
  51. type="text"
  52. size="small"
  53. @click="showCapacity(scope.row.capacityId)"
  54. v-if="show == false"
  55. >
  56. 查看详情
  57. </el-button>
  58. </template>
  59. </el-table-column>
  60. </dilTable>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. import { getCookie } from "@/utils/util.js";
  66. export default {
  67. data() {
  68. return {
  69. selectLoading: false,
  70. isKuang: false,
  71. tableloading: false,
  72. show: false,
  73. name: "homeworkPath",
  74. textInput: "",
  75. restaurants: [],
  76. ssoId: null,
  77. options: {
  78. // first请求数据的地址
  79. requestUrl: ""
  80. }
  81. };
  82. },
  83. created() {
  84. if (
  85. getCookie("orgCode") == "wuliuchuyunzhongxin" ||
  86. getCookie("orgCode") == "dagangadmin" ||
  87. getCookie("orgCode") == "zidonghuabu" ||
  88. getCookie("orgCode") == "chengyunshang"
  89. ) {
  90. this.show = true;
  91. }
  92. if (getCookie("orgCode") == "chengyunshang") {
  93. this.options.requestUrl =
  94. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  95. getCookie("userId");
  96. } else if (getCookie("orgCode") == "baohua") {
  97. this.options.requestUrl =
  98. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  99. getCookie("userId");
  100. } else {
  101. this.options.requestUrl =
  102. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" + null;
  103. }
  104. },
  105. methods: {
  106. func(res) {
  107. if (this.tableloading) {
  108. this.tableloading = false;
  109. }
  110. if (this.isKuang) {
  111. this.isKuang = false;
  112. }
  113. if (this.selectLoading) {
  114. this.selectLoading = false;
  115. }
  116. },
  117. onclick() {
  118. this.isKuang = true;
  119. this.tableloading = true;
  120. this.selectLoading = true;
  121. if (this.textInput) {
  122. if (getCookie("orgCode") == "chengyunshang") {
  123. this.options.requestUrl =
  124. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  125. getCookie("userId") +
  126. "&con=" +
  127. this.textInput +
  128. "&i=" +
  129. new Date();
  130. } else if (getCookie("orgCode") == "baohua") {
  131. this.options.requestUrl =
  132. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  133. getCookie("userId") +
  134. this.textInput +
  135. "&i=" +
  136. new Date();
  137. } else {
  138. this.options.requestUrl =
  139. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  140. null +
  141. "&con=" +
  142. this.textInput +
  143. "&i=" +
  144. new Date();
  145. }
  146. } else {
  147. if (getCookie("orgCode") == "chengyunshang") {
  148. this.options.requestUrl =
  149. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  150. getCookie("userId") +
  151. "&i=" +
  152. new Date();
  153. } else if (getCookie("orgCode") == "baohua") {
  154. this.options.requestUrl =
  155. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  156. getCookie("userId") +
  157. "&i=" +
  158. new Date();
  159. } else {
  160. this.options.requestUrl =
  161. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  162. null +
  163. "&i=" +
  164. new Date();
  165. }
  166. }
  167. },
  168. toInsert() {
  169. this.$router.push("/addCapacity");
  170. },
  171. toInsert1() {
  172. this.$router.push("/addOtherCapacity");
  173. },
  174. updateCapacity(capacityCarrierId) {
  175. // console.log("capacityCarrierId" +capacityCarrierId);
  176. this.$router.push("/editCapacity/" + capacityCarrierId);
  177. },
  178. showCapacity(capacityId) {
  179. this.$router.push("/showCapacity/" + capacityId);
  180. },
  181. deleteUser(userId) {
  182. this.axios.delete("pass/v1/sysusers/" + userId).then(res => {});
  183. },
  184. deleteCapacity(row) {
  185. console.log("row", row);
  186. console.log(row);
  187. let map = {
  188. capacityCarrierId: row.capacityCarrierId,
  189. carrierSSOId: getCookie("userId"),
  190. capacityId: row.capacityId
  191. };
  192. if (
  193. getCookie("orgCode") == "wuliuchuyunzhongxin" ||
  194. getCookie("orgCode") == "dagangadmin" ||
  195. getCookie("orgCode") == "zidonghuabu" ||
  196. getCookie("orgCode") == "chengyunshang"
  197. ) {
  198. this.$confirm(
  199. "是否删除与车牌号(" + row.capacityNumber + ")的绑定关系?",
  200. "提示",
  201. {
  202. confirmButtonText: "确定",
  203. cancelButtonText: "取消",
  204. type: "warning"
  205. }
  206. )
  207. .then(() => {
  208. this.axios
  209. .post("/api/v1/rms/deleteCapacityCarrier", map)
  210. .then(res => {
  211. if (res.data.code == "0") {
  212. this.$message.success("删除成功!");
  213. if (getCookie("orgCode") == "chengyunshang") {
  214. this.options.requestUrl =
  215. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  216. getCookie("userId") +
  217. "&i=" +
  218. new Date();
  219. } else if (getCookie("orgCode") == "baohua") {
  220. this.options.requestUrl =
  221. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  222. getCookie("userId") +
  223. "&i=" +
  224. new Date();
  225. } else {
  226. this.options.requestUrl =
  227. "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" +
  228. null +
  229. "&i=" +
  230. new Date();
  231. }
  232. }
  233. });
  234. })
  235. .catch(() => {
  236. this.$message({
  237. type: "info",
  238. message: "已取消删除"
  239. });
  240. });
  241. } else {
  242. this.$message.error("权限不足,请联系管理员!");
  243. }
  244. }
  245. }
  246. };
  247. </script>
  248. <style lang="scss" scode>
  249. .steel_inbound {
  250. .sache {
  251. padding: 1.25rem 0.375rem;
  252. .el-input {
  253. width: 20%;
  254. margin-right: 1.25rem;
  255. }
  256. }
  257. }
  258. </style>