capacity.vue 5.8 KB

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