timeTaskResult.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // 计时作业
  2. <template>
  3. <div class="sale">
  4. <div class="top">
  5. <!-- 框计算 -->
  6. <span class="text">计时时间:</span>
  7. <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
  8. </el-date-picker>
  9. <span class="text">至</span>
  10. <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
  11. </el-date-picker>
  12. <el-button type="primary" class="btn" @click="onclick">
  13. <i class="el-icon-search"></i>查询
  14. </el-button>
  15. </div>
  16. <div class="tab">
  17. <dilTable v-bind.sync="option" ref="table1">
  18. <el-table-column fixed="right" label="操作" width="180">
  19. <template slot-scope="scope">
  20. <div class="step">
  21. <el-button
  22. @click="getStepsList(scope.row)"
  23. type="text"
  24. size="small"
  25. >运输详情</el-button>
  26. </div>
  27. <!-- <el-button @click="" type="primary" style="margin-left: 16px;">
  28. 运输详情
  29. </el-button> -->
  30. </template>
  31. </el-table-column>
  32. </dilTable>
  33. </div>
  34. <!-- 运输进程详情 -->
  35. <el-drawer
  36. :visible.sync="drawer"
  37. :direction="direction">
  38. <!-- 步骤条显示 -->
  39. <div style="height: 200px;content-align:center" >
  40. <el-table
  41. :data="stepList"
  42. style="width: 100%">
  43. <el-table-column
  44. prop="linkName"
  45. label="计时状态"
  46. width="180">
  47. </el-table-column>
  48. <el-table-column
  49. prop="pointDate"
  50. label="时间"
  51. width="180">
  52. </el-table-column>
  53. </el-table>
  54. </div>
  55. </el-drawer>
  56. </div>
  57. </template>
  58. <script>
  59. import { getCookie } from "@/utils/util.js";
  60. import { sjTime } from "@/utils/sharedJsFile";
  61. export default {
  62. data(){
  63. return{
  64. inputText:'',
  65. option: {
  66. // 表格请求数据的地址
  67. requestUrl: "",
  68. },
  69. tableData: [],
  70. startTime: null,
  71. endTime: null,
  72. oldRow1: "",
  73. oldRowCount1: 1,
  74. drawer: false,
  75. direction: 'rtl',
  76. orderId: 0,
  77. stepList:[]
  78. }
  79. },
  80. created(){
  81. if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"||getCookie("orgCode") == "wuliuchuyunzhongxin"){
  82. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458"
  83. }else{
  84. console.log("cookier"+getCookie("userId"))
  85. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458&orgCode="+getCookie("userId");
  86. }
  87. },
  88. methods:{
  89. getStepsList(row){
  90. console.log(row.orderId)
  91. this.orderId = row.orderId
  92. this.drawer = true
  93. let map = {
  94. orderId : this.orderId
  95. }
  96. this.axios.post("/api/v1/oms/getOrderResult",map)
  97. .then((res) => {
  98. console.log(res)
  99. if (res.status == 200) {
  100. this.stepList = res.data
  101. } else {
  102. this.$message.error("展示失败!");
  103. }
  104. });
  105. console.log(this.stepList)
  106. },
  107. getRequirementMaterial1(row) {
  108. // 记录重复点击次数
  109. if (this.oldRow1 === row) {
  110. this.oldRowCount1 += 1;
  111. }
  112. // 切换当前详情表
  113. this.$refs.table1.toggleRowExpansion(row);
  114. // 打开前关闭上一个详情表
  115. if (this.oldRow1 != "") {
  116. if (this.oldRow1 != row) {
  117. if (this.oldRowCount1 % 2 === 1) {
  118. this.$refs.table1.toggleRowExpansion(this.oldRow1);
  119. } else {
  120. this.oldRowCount1 = 1;
  121. }
  122. } else {
  123. this.oldRow1 = null;
  124. return;
  125. }
  126. }
  127. // 重置上一个点击对象
  128. this.oldRow1 = row;
  129. this.getMaterial(row.orderId);
  130. },
  131. onclick(){
  132. let startTime = null;
  133. let endTime = null;
  134. if (this.startTime) {
  135. startTime = sjTime(this.startTime);
  136. }
  137. if (this.endTime) {
  138. endTime = sjTime(this.endTime);
  139. }
  140. if (startTime && endTime) {
  141. if (startTime < endTime) {
  142. console.log(startTime)
  143. console.log(endTime)
  144. if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"||getCookie("orgCode") == "wuliuchuyunzhongxin"){
  145. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
  146. }else{
  147. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458&orgCode="+getCookie("userId")+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
  148. }
  149. } else {
  150. this.startTime = null;
  151. this.endTime = null;
  152. this.$message.warning("开始时间要比结束时间早");
  153. }
  154. } else {
  155. }
  156. },
  157. getMaterial(orderId){
  158. console.log(orderId)
  159. this.axios.post("/api/v1/oms/getPauseTimeTaskDetail/" + orderId).then((res) => {
  160. console.log(res)
  161. this.tableData = res.data.data
  162. })
  163. },
  164. }
  165. }
  166. </script>
  167. <style lang="scss">
  168. .sale{
  169. .top {
  170. padding: 1.25rem 1.875rem;
  171. .el-input{
  172. width: 20%;
  173. }
  174. }
  175. }
  176. .el-table th.el-table__cell>.cell {
  177. display: inline-block;
  178. -webkit-box-sizing: border-box;
  179. box-sizing: border-box;
  180. position: relative;
  181. vertical-align: middle;
  182. padding-left: 10px;
  183. padding-right: 10px;
  184. width: 100%;
  185. text-align: center;
  186. }
  187. .step {
  188. text-align: center;
  189. }
  190. </style>