capacity.vue 6.4 KB

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